ATR Normalized Indicator for ThinkorSwim

alvissome

New member
Hi there I'm new here and I'm trying to come out a thinkscript similar to the video below.


Adam Khoo uses it in combination with William R to determine market bottom. However I couldn't quite get the thinkscript portion of it, anyone is able to offer any insights that comes close to his?
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I will take a look at creating one, see what I get.

Code:
declare lower;

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

def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);

plot normal =( atr/close * 1000);

Could easily be all coded together with trigger arrows will look at that tomorrow.

I tested the idea and it has only found 2 times in 15 years it would have triggered, Tried running it on lower time frames than a weekly and it is of no value so not sure worth going any further.

What normalized atr are you using in TradingView?
 
Per the requests in this post; I've created a version of this study. I think it's quite helpful in classifying the volatility of the market:

RkRM7Cs.png


Ruby:
#APTR Percentile Rank for ThinkorSwim Version 1.0
#
#VERSION
# 2020.04.11 V1.0 @diazlaz - Initial Release
#
#
#INSTRUCTION
#ATR PercentileRank - Great For Showing Market Bottoms.
#
#When Increased Volatility to the Downside Reaches Extreme Levels
#it’s Usually a Sign of a Market Bottom.
#
#This Indicator Takes the ATR and uses a different LookBack Period
#to calculate the Percentile Rank of ATR Which is a Great Way To
#Calculate Volatility
#
#

declare lower;

input length = 10;
input length2 = 100; #no. of Bars the PercentileRank uses to Calculate Rank
input averageType = AverageType.WILDERS;
input paintBars = yes;
input showLabels = yes;

#LABELS
AddLabel (showLabels, "APTR Percentile Rank for ThinkorSwim Version 1.0", COLOR.ORANGE);

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

#Percentile Rank Calculation
def percentRankCount = fold i = 1 to length2 + 1 with count = 0
do
  if APTR[0] > APTR[i] then
    count + 1
  else
    count;
def percentRank = Round( percentRankCount / length2 * 100.0, 0);

#PLOTS
plot pATRRank = percentRank;
pATRRank.SetLineWeight(2);
pATRRank.SetDefaultColor(GetColor(8));

plot p25 = 25;
plot p50 = 50;
plot p75 = 75;

p25.setDefaultColor(COLOR.DARK_GRAY);
p25.HideTitle();
p25.HideBubble();

p50.setDefaultColor(COLOR.DARK_GRAY);
p50.HideTitle();
p50.HideBubble();

p75.setDefaultColor(COLOR.DARK_GRAY);
p75.HideTitle();
p75.HideBubble();

#END Of APTR Percentile Rank for ThinkorSwim Version 1.0
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
291 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top