• Memorial Day Sale! Claim the biggest discount of the year with $50 off VIP using code MEM50. Sign up here.

Best ATR ADR Indicator (with %) For ThinkOrSwim

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.

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
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?
 

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
Lifetime
@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

Active member
VIP
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
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?
 

Drmoh1800

Member
Can you be more concise in your question?
Very confused to what you are asking
Thank you, sorry for the confusion
I am looking for scan ATR is greater than first 5 minutes candle (9:30to 9:35)range( high minus low )
For example : stock X ATR is 5
And range of 5 minutes candle range is 6
Its will not show up in results
But if ATR is 5
And the range of 5 minute candle range is 4
It will show up in results .
 

jngy2k

Member
@drmog1800 yeah it is super simple

plot scan= atr>5 and high-low<atr;

You are going to have to understand simple scipts if you going to master KQ and EG methods on TOS
 

wussay

New member
VIP
@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;
Pensar how do I edited the scan to show stocks that have a "today %" higher than the " Avg %"
 

Pensar

Well-known member
VIP
Lifetime
@wussay perhaps something like this (coded in forum)
Code:
def length = 14;
def adr = (average(high - low, length)/close*100);
plot scan = round((close-close[1])/close[1]*100) > adr;
 

Woody556

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

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
This is a great code! Is there a way to display this indicator in the same box with the volume bars underneath the chart? I hope this question makes sense.
 

jngy2k

Member
This is a great code! Is there a way to display this indicator in the same box with the volume bars underneath the chart? I hope this question makes sense.
I think you mean volume bars in the same area as the atr indicator which you can but because the volume need their own numbers on the right hand side and atr needs their own numbers on the right hand side the ATR indicator will be compressed real low because their numbers are scaled to the volume numbers. You can use this indicator and add VolumeAvg indicator from TOS to the lower chart.
 
Top