jngy2k
Member
I couldn't find one in this forum that was simple and showed percentages of the price. Plots both ADR and ATR with their percentages as labels.
Let me know if it can be improved.
Let me know if it can be improved.
Code:
declare lower;
input length = 14;
plot ATR = MovingAverage(AverageType.wilders, TrueRange(high, close, low), length);
ATR.SetDefaultColor(GetColor(8));
AddLabel (yes, "ATR:" + Round((ATR / close) * 100, 3) + "%", Color.WHITE);
AddLabel (yes, "ATR:" + round((ATR) , 3), Color.white);
plot ADR = MovingAverage(AverageType.wilders, high-low, length);
ADR.SetDefaultColor(GetColor(6));
AddLabel (yes, "ADR:" + round((ADR) , 3), Color.light_green);
AddLabel (yes, "ADR:" + Round((ADR / close) * 100, 3) + "%", Color.light_green);
Last edited: