Best ATR ADR Indicator I came up with today (with %)

jngy2k

Member
VIP
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.

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);

ky8H7enh.jpg
 
Last edited:

Jay007

New member
VIP
Hi,

Does anyone have a label to display the Average Daily range as a percentage?

Edit: Thanks, I will play with it. Appreciate it. This community is great.
 

Jonas99

New member
VIP
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.

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);

ky8H7enh.jpg
is ADR here also DTR? I see some use ATR vs DTR; what are the difference?
 

Pensar

Active member
VIP
Is it possible to scan for stocks with an ADR % above 5?

@MColb Yes. Try the below code, make sure to change the length to however many bars you wish to use as the average.

Code:
# Scan for Average Daily Range of 14 bars to be > 5%
def length = 14;
plot scan = (average(high - low, length)/close*100) > 5;
 

MColb

New member
@MColb Yes. Try the below code, make sure to change the length to however many bars you wish to use as the average.

Code:
# Scan for Average Daily Range of 14 bars to be > 5%
def length = 14;
plot scan = (average(high - low, length)/close*100) > 5;
Is 14 the common bar amount to use?
 

Pensar

Active member
VIP
@MColb It depends on the user. Some I see use 5 bars (a week on the daily chart), others use 20-22 bars, which is around a month. Its all up to your personal preference. I myself use 20 bars on a daily aggregation as part of my scans, but that doesnt mean I would recommend doing so, its just what I prefer.
 

Similar threads

Top