Volatility Step Bands For ThinkOrSwim

cando13579

Active member
VIP
Volatility Step Bands
Concept Overview:
The Volatility Step Bands indicator is designed to map the evolving structure of a price chart by identifying dynamic support and resistance levels that actively contain price action. Unlike traditional channels that price frequently crosses, this tool creates an adaptive boundary that moves with the price, providing a clear visual representation of the established high and low ranges within different market regimes.

The upper chart Perfect SuperTrend can be found: https://usethinkscript.com/threads/perfect-supertrend-for-thinkorswim.21868/
volatility-bands.png


Core Methodology:
  1. Price Extreme Foundation: Establishes a baseline by calculating the highest high and lowest low over a defined lookback period (Length).
  2. Volatility-Based Containment Zone: A multiple of the Average True Range (ATR_Multiplier) is added to the highest high and subtracted from the lowest low. This creates a buffer zone that adapts its width to current market volatility, forming a dynamic channel that price tends to respect.
  3. Dual-Layer Analysis: The indicator provides two complementary views of market structure:
    • Confirmed Step Levels (HighLine/LowLine): These plot as continuous lines that only "step" to a new level when price establishes a definitive new high or low. They represent the committed market structure.
    • Projected Boundaries (PriceShift): These points update on every bar, projecting the immediate boundary of the containment channel based on the most recent data. They represent the frontier of current price action.
Key Operational Modes:
  • Adaptive Mode (Rigid = No):
    • Use Case: Provides the most complete structural picture. The Projected Boundaries show where the channel is forming in real-time, while the Confirmed Step Levels show the key structural pillars that are in force. This is ideal for understanding the ongoing battle between buyers and sellers at the channel edges.
  • Confirmed Mode (Rigid = Yes):
    • Use Case: Filters out noise and focuses only on significant, confirmed structural shifts. All plots adhere to the stepped logic. This is preferred for identifying major support/resistance levels and confirming that a change in market structure has truly occurred.
Trading and Analysis Applications:
  • Identifying Range Boundaries: The primary function is to visually define the upper and lower bounds of a trading range or trend channel.
  • Structural Break Confirmation: A "step" in the confirmed levels (e.g., the lower band stepping down) signals a confirmed break in market structure, often leading to a new leg in the trend.
  • Support/Resistance Validation: Price reacting at or near the bands (touches, bounces, rejections) validates their strength as dynamic support and resistance areas.
  • Volatility & Trend Assessment: The width between bands indicates volatility, while the sequence and direction of the "steps" visually illustrate the trend's direction and strength.
Conclusion:
The Volatility Step Bands indicator is not a crossover tool but a sophisticated structural mapping system. It excels at framing price action within a volatility-adjusted context, allowing traders to visually identify the dominant trading range, spot confirmations of structural shifts, and make informed decisions at key dynamic support and resistance levels.
Recommended Timeframes & Context:
  • Primary Application: Swing & Position Trading
    • Recommended Timeframes: Daily (D), 4-Hour (4H), 8-Hour (8H)
    • Context: On higher timeframes, the "step" changes represent significant, high-confidence shifts in market structure. The bands provide clear, stable levels for strategic position entry, stop placement, and trend analysis.
  • Secondary Application: Intraday & Active Trading
    • Recommended Timeframes: 1-Hour (1H), 15-Minute (15m), 5-Minute (5m)
    • Context: On lower timeframes, the indicator is excellent for identifying the boundaries of intraday ranges and capturing short-term momentum. Use Rigid = No (Adaptive Mode) to see both immediate and confirmed levels for more responsive trading. Expect more frequent, but less significant, "steps."
  • Parameter Adjustment Guide:
    • Higher Timeframes (D, 4H): Use longer Length (14-20) and a standard ATR_Multiplier (0.5-1.0) for broader, more significant structural levels.
    • Lower Timeframes (15m, 5m): Use shorter Length (8-12) and a smaller ATR_Multiplier (0.3-0.6) for more responsive levels that adapt to faster price action.
you guys are welcome to make adjustments, improve it or whatever needs done to make it more useful.

Code:
# Volatility Step Bands
# By CANDO13579

declare upper;

input ATR_Period = 14;
input ATR_Multiplier = 0.5;
input Length = 10;
input Rigid = no;

def atr = Average(TrueRange(high, close, low), ATR_Period);

# Calculate highest and lowest values
def highestHigh = Highest(high, Length);
def lowestLow = Lowest(low, Length);

# use current ATR value instead of offset
def upper_val = highestHigh + (atr * ATR_Multiplier);
def lower_val = lowestLow - (atr * ATR_Multiplier);

# Stepped versions for High/Low plots
def upper_step;
def lower_step;
if IsNaN(upper_step[1]) {
upper_step = upper_val;
lower_step = lower_val;
} else {
upper_step = if upper_val != upper_step[1] then upper_val else upper_step[1];
lower_step = if lower_val != lower_step[1] then lower_val else lower_step[1];
}

# Continuous or rigid for PriceShift plots
def upper_cont = if Rigid then upper_step else upper_val;
def lower_cont = if Rigid then lower_step else lower_val;

plot PriceShiftResistance = upper_cont;
PriceShiftResistance.SetDefaultColor(Color.GRAY);
PriceShiftResistance.SetStyle(Curve.POINTS);
PriceShiftResistance.SetLineWeight(1);

plot PriceShiftSupport = lower_cont;
PriceShiftSupport.SetDefaultColor(Color.GRAY);
PriceShiftSupport.SetStyle(Curve.POINTS);
PriceShiftSupport.SetLineWeight(1);

plot HighLine = upper_step;
HighLine.SetDefaultColor(Color.RED);
HighLine.SetLineWeight(1);

plot LowLine = lower_step;
LowLine.SetDefaultColor(Color.GREEN);
LowLine.SetLineWeight(1);
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
512 Online
Create Post

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