Hi, this ATR_Mod was provided by one of our members and what I want is to customize a SCAN when the PLOT Line changes from GREEN to RED. I tried to build when ATRM crosses zero within 1 bar but the results generated is not accurate.
Request if anyone can help me with this.
Thanks
Request if anyone can help me with this.
Thanks
Code:
### ATR Mod ###
declare lower;
input length = 20;
input length2 = 5;
input averageType = AverageType.WILDERS;
def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
def ATRA = MovingAverage(averageType, atr, length2);
plot zeroline=0;
plot ATRM = ((ATR- ATRA) /close)*100;
ATRM.SetPaintingStrategy(PaintingStrategy.LiNE);
ATRM.AssignValueColor(if ATRM >= 0 then Color.downtick else Color.uptick);