23 lis 2021
ultiplier input(title="ATR Multiplier, type-input.float, step-2.5, defval-2.5) changeATR input (title-"Change ATR Calculation Method , type-input.bool, defval-trum) showsignals input (title="teo Signals , type-input.bool, defval-false) highlighting input(title="Highlighter On/Off ?", type-input.bool, defval-false) atr2 sma(tr, Periods) ate changeATR ? atr(Periods) : atr2 up-src-(Multiplier ate) upl - nz (up[1],up) dn-src.(Multiplier atr) E up close[1] > up1 ? max(up, up1) : up nl - nz(dn[1], dn) dn t close [1] <dnl 7 min(dn, de1) t de trend 1 trend nz (trend[1], trend) trend : trend 1 and close > dl ? 1 : trend 1 and close cupl 2-1: trend upplot plot(trend-02 up: na, title="Up Trend", style-plot.style linebe, linewidth-2, color-color.green) buySignal trend 1 and trend[1] -- plotshape(buySignal ? up na, title="Leo Up", location location.belowbar, style-shape.triangleup, size-size.tiny, color color.blue, plotshape (buySignal and showsignals up: na, title-"LONG", text-"long", location-location.absolute, style-shape.labelup, size-size.t sellSignal trend -1 and trend[1] 1 plotshape(sellSignal ? dn na, title="Leo Down", location-location.abovebär, style-shape.triangledown, size-size.tiny, color-color.bl plotshape(sellSignal and showsignals ? dn na, title-"SHORT", text-"Short", location-location.absolute, style-shape.labeldown, size-s Plot plot (ohlc4, title-, style-plot.style circles, linewidth-0) longFillColor highlighting? (trend? color.green: color.white) color white shortfillColor highlighting? (trend-color.red color, white): color white alertcondition (buySignal, title-"Leo Buy", message-"Leo Buy") alertcondition(sellSignal, title="Leo sell", message="Leo sell") changeCond trend 1- trend[1] alertcondition(changeCond, title="teo Direction Change", message-"Trend has changed direction!")