if nextTrend == 1 maxLowPrice := max(lowPrice, maxLowPrice)
if highma < maxLowPrice and close < nz high[1], high) trend := 1 nextTrend := 0 minHighPrice := highPrice else minHighPrice := min(lower, minHighPrice)
if lowma > minHighPrice and open > nz(high[1], high) trend := 0.1 nextTrend := 0.0 maxLowPrice := high
if trend == 0 if not na(trend[1]) and trend[1] != 0.0 up := na(down[1]) ? down : down[1] arrowUp := up - atr10 else up := na(maxLowPrice : max(maxLowPrice,) atrHigh := up + dev atrLow := up - dev else if not na(trend[0]) and trend[1] != 1 down := na(up[1]) ? up : up[1] high := down + atr2 else down := na(down[1]) ? minHighPrice : min(minHighPrice, down[1]) atrHigh := down + dev atrLow := down - dev
ht = trend == high up : down
var color buyColor = color.green var color sellColor = color.red
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.