Skip to content

Instantly share code, notes, and snippets.

View f-gueguen's full-sized avatar

Francois f-gueguen

View GitHub Profile
@f-gueguen
f-gueguen / cto_line.pine
Created November 15, 2022 01:37 — forked from basnijholt/cto_line.pine
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)