ATR Normalized


Category:
0
0

Hey Pete, again a big thank you for all your sharing and I’ve learnt a few tricks from your sharing.

Yesterday I watched a short video https://youtu.be/zf26u-2I1yE?t=225 where the presenter mentioned a combination use of William R and Normalized ATR to determine market bottom, however there seems to be some guessing works to figure out the script he uses.. I attempted my own but came nothing near to what he has, perhaps I’m missing out something – could you point me to the right direction? My novice script below:

declare lower;

input length = 14;
input averageType = AverageType.WILDERS;
input over_sold = 30.5;

script normalizePlot {
input data = close;
input llength = 52;
input newRngMin = 0;
input newRngMax = 100;
def hhData = Highest( data, llength );
def llData = Lowest( data, llength );
plot nr = ((( newRngMax – newRngMin ) * ( data – llData )) / ( hhData – llData )) + newRngMin;
}

def bottom = Min(close[1], low);
def tr = TrueRange(high, close, low);
def ptr = tr / (bottom + tr / 2) * 100;

def APTR = MovingAverage(averageType, ptr, length);
plot NAPTR = normalizePlot(APTR);
plot oversold = over_sold;
NAPTR.SetDefaultColor(GetColor(8));
NAPTR.DefineColor(“oversold”, GetColor(5));

Marked as spam
Posted by (Questions: 4, Answers: 3)
Asked on April 3, 2020 6:03 pm
890 views
0
Private answer

Couple things to cover before we attempt to solve this. First detail is that we don't waste our time trying reverse engineer other charting tools. Videos and screenshots are never sufficient to create a charting tool. Second detail is that we need source code or a clear set of specifications.

When you post questions in the future, be sure that you are providing one of those two things. Either the source code from another platform or the exact specifications. The only reason to provide a video or screenshot is to support the clear list of specifications you provide or to show the source code displayed on the other platform.

In this case we have a platform named TradingView. We have already converted several scripts from this platform to Thinkorswim. From the video we see the name of the study is "ATR Normalized". The problem is that when we go to TradingView and look for a study by that name we don't find it. So the author of that video likely has one that is locked and not accessible to general public.

However we do find a couple different versions on TradingView named "Normalized Average True Range". Both produce very similar outputs. The source code for the most basic one follows:

//@version=3
// Copyright (c) 2018-present, Alex Orekhov (everget)
// Normalized Average True Range script may be freely distributed under the MIT license.
study("Normalized Average True Range", shorttitle="NATR")
length = input(title="Length", type=integer, defval=14)
natr = 100 * atr(length) / close
plot(natr, color=#ff9800, transp=0)

Now that is the code straight from TradingView. This is the source code from the other platform. We cannot use this directly in Thinkorswim so we have to translate this to a form that works in Thinkorswim:

input length = 14;
plot natr = 100 * ATR(length) / close;

The only way to ensure this matches the one displayed in the video you linked to is to load this on chart and compare it to the values displayed on the video. I'll leave that to you.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 4, 2020 8:07 am