In TOS, there is an indicator HeikinAshiDiff (HAD). I observed this indicator and it follows the HA paint bars. When the HAD, is above the zero line, the chart candle is green and when it crosses below zero line the candle is red. I need some help in making the indicator to be green when rising and red when going lower. Or like a Histogram where up is green and down is red. Sometimes when the HAD indicator reverses before it approaches the zero line, it is warning that the paint bar is going to change soon. Thank you in advance.
# # TD Ameritrade IP Company, Inc. (c) 2008-2020 # declare lower; input smoothingLength = 3; def haclose = (open + high + low + close) / 4; def haopen = CompoundValue(1, (haopen + haclose) / 2, (open + close) / 2); def diff = haclose - haopen; plot HADiff = diff; plot Avg = Average(diff, smoothingLength); plot ZeroLine = 0; HADiff.SetDefaultColor(GetColor(1)); Avg.SetDefaultColor(GetColor(8)); ZeroLine.SetDefaultColor(GetColor(5)); # END