Can someone create an ATR Ratio indicator?

FrankN

New member
VIP
Greetings, I was reading/learning about the use of ATR, and saw something that interested me. I use ATR as a lower study, and set horizontal lines for Low volume, Ideal zone, and High volume, on a 2 minute chart for futures trading, with a period of 5.
Can someone create a simple lower chart for this?
Thoughts? TIA

How to Refine Your "Safe Zone"
Instead of using fixed numbers like "15, 25, 45,"etc. many professionals use the ATR Ratio. You compare the current 5-period ATR (on a 2 min chart) to a longer 20-period ATR.

  • If the 5-period is 1.5x higher than the 20-period, you have a volatility breakout
  • If the 5-period is less than 0.8x of the 20-period, the market is "asleep."
 
Last edited by a moderator:
Greetings, I was reading/learning about the use of ATR, and saw something that interested me. I use ATR as a lower study, and set horizontal lines for Low volume, Ideal zone, and High volume, on a 2 minute chart for futures trading, with a period of 5.
Can someone create a simple lower chart for this?
Thoughts? TIA

How to Refine Your "Safe Zone"
Instead of using fixed numbers like "15, 25, 45,"etc. many professionals use the ATR Ratio. You compare the current 5-period ATR (on a 2 min chart) to a longer 20-period ATR.

  • If the 5-period is 1.5x higher than the 20-period, you have a volatility breakout
  • If the 5-period is less than 0.8x of the 20-period, the market is "asleep."
Code:
declare lower;

input FastATRLength = 5;
input SlowATRLength = 20;

def ATRfast = Average(TrueRange(high, close, low), FastATRLength);
def ATRslow = Average(TrueRange(high, close, low), SlowATRLength);

def ATRratio = ATRfast / ATRslow;

plot Ratio = ATRratio;
Ratio.SetLineWeight(2);

# Zone Levels
plot SleepLevel = 0.8;
SleepLevel.SetDefaultColor(Color.GRAY);
SleepLevel.SetStyle(Curve.SHORT_DASH);

plot IdealLevel = 1.0;
IdealLevel.SetDefaultColor(Color.YELLOW);

plot BreakoutLevel = 1.5;
BreakoutLevel.SetDefaultColor(Color.RED);
BreakoutLevel.SetStyle(Curve.SHORT_DASH);

# Coloring the ratio line
Ratio.AssignValueColor(
    if ATRratio < SleepLevel then Color.DARK_GRAY
    else if ATRratio < BreakoutLevel then Color.GREEN
    else Color.RED
);
 

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

If you are into futures use this on the 1-3 minute charts
Code:
# ANTWERKS

declare lower;

input FastATRLength = 5;
input SlowATRLength = 20;
input CompressionLevel = 0.8;
input ExpansionLevel = 1.5;
input AccelThreshold = 0.15;

# ATR calculations
def ATRfast = Average(TrueRange(high, close, low), FastATRLength);
def ATRslow = Average(TrueRange(high, close, low), SlowATRLength);

def ATRratio = ATRfast / ATRslow;
def ATRaccel = ATRfast - ATRfast[1];

plot Ratio = ATRratio;
Ratio.SetLineWeight(2);

# Zone lines
plot Compression = CompressionLevel;
Compression.SetDefaultColor(Color.GRAY);
Compression.SetStyle(Curve.SHORT_DASH);

plot Neutral = 1.0;
Neutral.SetDefaultColor(Color.YELLOW);

plot Expansion = ExpansionLevel;
Expansion.SetDefaultColor(Color.RED);
Expansion.SetStyle(Curve.SHORT_DASH);

# Ratio color logic
Ratio.AssignValueColor(
    if ATRratio < CompressionLevel then Color.DARK_GRAY
    else if ATRratio < ExpansionLevel then Color.GREEN
    else Color.RED
);

# ACCELERATION DETECTION
plot Acceleration = if ATRaccel > AccelThreshold then ATRratio else Double.NaN;
Acceleration.SetPaintingStrategy(PaintingStrategy.POINTS);
Acceleration.SetLineWeight(4);
Acceleration.SetDefaultColor(Color.CYAN);

# COMPRESSION SQUEEZE
def Squeeze = ATRratio < CompressionLevel;

plot CompressionSignal = if Squeeze then ATRratio else Double.NaN;
CompressionSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
CompressionSignal.SetDefaultColor(Color.YELLOW);
CompressionSignal.SetLineWeight(3);

# LABELS
AddLabel(yes,
    if ATRratio < CompressionLevel then "VOLATILITY COMPRESSION"
    else if ATRratio < ExpansionLevel then "IDEAL TRADING VOLATILITY"
    else "VOLATILITY EXPANSION",
    
    if ATRratio < CompressionLevel then Color.GRAY
    else if ATRratio < ExpansionLevel then Color.GREEN
    else Color.RED);

AddLabel(yes,
    if ATRaccel > AccelThreshold then "ATR ACCELERATION (BREAKOUT RISK)"
    else "ATR STABLE",
    
    if ATRaccel > AccelThreshold then Color.CYAN
    else Color.GRAY);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
786 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