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

Active 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

Well-known 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

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

Well-known 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.
 

rad14733

Well-known member
VIP
@MColb Yes, 14 is a common number... I, on the other hand, use Fibonacci Numbers and primarily, 3, 5, 8, 13, 21, 34, 55, and 89...
 

rlohmeyer

Member
Here is one I use on my trading chart so I can see where % range is for today relative to an average of day:

Code:
#Avg Day Range %
#@rlohmeyer
def Hi = high(period = AggregationPeriod.DAY);
def Lo = low(period = AggregationPeriod.DAY);
def DRngP = Round((Hi - Lo) / Lo * 100, 2);
input Avg = AverageType.Exponential;
input Lngth = 5;
def ADRP = Round(MovingAverage(Avg, DRngP, Lngth),2);
AddLabel(yes,"ADR| " + "Type: "+ Avg +"  Lngth: " + Lngth + "  Avg: " + ADRP + "%" + "  Today: " + DRngP + "%", color.light_gray);
 

COLORADOTIM

New member
VIP
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);
Hi , thanks for this cool indicator, super useful. I was wondering if you could help me how to use it in a scan and add it to my watchlist. I'm new to TOS . Thanks!
 

jngy2k

Member
VIP
Hi , thanks for this cool indicator, super useful. I was wondering if you could help me how to use it in a scan and add it to my watchlist. I'm new to TOS . Thanks!
#column
plot ATR = MovingAverage(AverageType.wilders, TrueRange(high, close, low), 14);

#scan
def ATR = MovingAverage(AverageType.wilders, TrueRange(high, close, low), 14);
plot scan=atr>3;
 

esti0000

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
Thank you for this very useful code.
I was wondering if there was a way to plot the ADR percentage instead of the dollar value?
 

Similar threads

Top