Professional Documents
Culture Documents
Ashish (Halftrend)
Ashish (Halftrend)
study("HalfTrend", overlay=true)
float arrowUp = na
float arrowDown = na
atr2 = atr(100) / 2
highPrice = high[abs(highestbars(amplitude))]
lowPrice = low[abs(lowestbars(amplitude))]
highma = sma(high, amplitude)
if nextTrend == 1
trend := 1
nextTrend := 0
minHighPrice := highPrice
else
trend := 0
nextTrend := 1
maxLowPrice := lowPrice
if trend == 0
arrowUp := up - atr2
else
atrHigh := up + dev
atrLow := up - dev
else
else
ht = trend == 0 ? up : down