OPEN-SOURCE SCRIPT
Updated ATR Static Zone

═══════════════════════════════════════════════════════════
DESCRIPTION
═══════════════════════════════════════════════════════════
ATR Static Zones plots volatility-based price zones and Fibonacci
levels for four timeframes simultaneously — Daily, Weekly, Monthly,
and Quarterly — on any intraday or higher chart timeframe.
Each zone is anchored to the previous period close or the current
period open, depending on the selected method and anchor mode. The
anchor and ATR value are locked at the start of each new period and
do not shift during the period, giving static reference levels that
remain in place as price moves.
The key differentiator of this script is the choice of four ATR
calculation formulas, each suited to different market conditions.
ATR FORMULAS
Dante (Wilder RMA) — the original Wilder smoothed ATR using a
running moving average. Anchor is the previous period close. This is
the standard method used by most traders and platforms.
Dante (Open) — same Wilder ATR formula, but the anchor is set to the
opening price of the current period instead of the prior close. Useful
when the period open is more significant than the prior close, for
example when gaps are common.
Rogers-Satchell — a volatility estimator based on all four OHLC
prices within each period bar. It uses the formula:
sigma squared = ln(H/C) x ln(H/O) + ln(L/C) x ln(L/O).
This method accounts for intraperiod trending and produces a lower
bias than close-to-close methods. It does not account for overnight
gaps between periods.
Yang-Zhang — the most accurate OHLC estimator. It combines the
overnight component (open vs. prior close), the open-to-close
component, and the Rogers-Satchell estimator with an optimal
weighting coefficient k. This method handles both intraperiod trends
and overnight gaps, producing minimum variance estimates. It is
recommended for instruments that gap frequently, such as futures,
stocks, or crypto across sessions.
All four formulas are applied using the same ATR period setting and
produce output in price units so zone levels are directly usable on
any chart.
ANCHOR MODE
Static (default) — the anchor and ATR are calculated once at the
start of each new period and held fixed until the next period begins.
Zone levels do not move as price action develops during the period.
Dynamic — the anchor and ATR are recalculated on every bar using live
HTF data. Useful for seeing how zones would shift if the period closed
at the current price. The zone levels will move during the period.
TIMEFRAMES
Each of the four timeframes — Daily, Weekly, Monthly, Quarterly — can
be independently enabled or disabled. Fibonacci levels can also be
toggled per timeframe separately from the zone bands. A warning label
appears automatically if the chart timeframe is equal to or higher
than a selected calculation timeframe, since in that case the zones
would not provide useful sub-period reference.
FIBONACCI LEVELS
When Fibonacci levels are enabled for a timeframe, the following
levels are drawn symmetrically above and below the anchor using the
period ATR as the unit of measurement:
Anchor (previous close) — midpoint
+/- 23.6% — call and put trigger zones
+/- 38.2% — intermediate level
+/- 50.0% — half-ATR from anchor
+/- 61.8% — key target level
+/- 78.6% — deep retracement
+/- 100% — full ATR zone boundaries
+/- 123.6% — extension
+/- 138.2% — extension
+/- 161.8% — extension
+/- 200% — double ATR extension
Each level can be individually toggled. The line style (solid, dashed,
dotted) and line width are adjustable. Each level has its own color
setting. Text labels showing the level percentage and price appear at
the right end of each Fibonacci line.
Fibonacci lines are anchored to the first bar of each period (x1) and
their right endpoint (x2) is extended to the current bar on every
update. They do not extend to infinity.
VOLATILITY ANALYTICS
The info table includes a set of volatility metrics for each
timeframe, providing context beyond the raw ATR value:
ATR Percentile — shows where the current ATR stands relative to the
last N periods (default 52). A reading of 0 percent means the ATR is
at a historical low for the lookback window. A reading of 100 percent
means it is at a historical high. This helps identify whether
volatility is compressed or expanded.
Volatility Regime — automatically classifies the current environment
as Low, Normal, High, or Extreme based on the ATR Percentile. This
gives an immediate qualitative read on market conditions.
ATR Expansion / Contraction — compares the current ATR to an EMA of
ATR over a configurable period. When ATR is above its EMA, the label
shows Expansion (impulse conditions). When ATR is below its EMA, it
shows Contraction (accumulation or consolidation conditions).
Expected Move — shows how much of the period ATR range has not yet
been consumed. Calculated as (ATR minus current period high-low range)
expressed as a percentage. When this value approaches zero, the
expected range for the period has been largely used up.
ATR Delta — shows the percentage change in ATR compared to the
previous period. A sharp positive delta indicates a sudden increase
in volatility. A negative delta indicates that conditions are calming
relative to the prior period.
Range Utilization — shows (high minus low of the current period)
divided by ATR, expressed as a percentage. Color coding in the table
cell gives an immediate read: green for under 50 percent, yellow for
50 to 80 percent, red for over 80 percent.
INFO TABLE
The info table displays all analytics for all four timeframes in one
place. Columns: ATR value, Range Utilization, ATR Percentile,
Volatility Regime, Expansion/Contraction, Expected Move, ATR Delta.
Below the period rows, the table shows anchors for Weekly, Monthly,
and Quarterly, Fibonacci trigger levels for the current week, the
active ATR method, and the anchor mode.
Table position can be set to any of the four screen corners.
Table text size is adjustable: Small, Normal, or Large.
ZONE HIGHLIGHTING
Barcolor highlighting is available as an optional toggle. When enabled,
candles that close above the upper ATR zone are highlighted in the
upper zone color, and candles that close below the lower ATR zone are
highlighted in the lower zone color. This makes breakouts immediately
visible without needing to watch price relative to the zone bands.
ALERTS (14 conditions)
Weekly ATR upper zone breakout
Weekly ATR lower zone breakout
Monthly ATR upper zone breakout
Monthly ATR lower zone breakout
Quarterly ATR upper zone breakout
Quarterly ATR lower zone breakout
Weekly +23.6% (call trigger) crossover upward
Weekly -23.6% (put trigger) crossunder downward
Weekly +61.8% (key level) crossover upward
Weekly -61.8% (key level) crossunder downward
Daily +23.6% crossover upward
Daily -23.6% crossunder downward
Daily +61.8% crossover upward
Daily -61.8% crossunder downward
HOW TO USE
1. Add the indicator to any intraday or daily chart. Weekly and
Monthly timeframes are most useful on timeframes from 1 hour down
to 5 minutes.
2. Select the ATR formula. For most equity and crypto markets, Yang-
Zhang produces the most accurate zone placement because it accounts
for gaps between sessions. For forex with nearly continuous trading,
Rogers-Satchell or Dante Wilder are typically sufficient.
3. Leave anchor mode on Static for reference trading. This gives
stable, non-moving zones for the duration of each period. Switch to
Dynamic only for exploratory analysis.
4. The anchor line (dotted) marks the previous close — the neutral
reference. Price above the anchor within the weekly period
generally indicates strength. Price below indicates weakness.
5. The +/-23.6% levels are early entry trigger zones. The +/-61.8%
levels are key retracement areas with higher statistical
significance. The +/-100% levels (zone bands) mark the statistical
full-range boundary.
6. Use Range Utilization to assess remaining potential. If a period
has already consumed more than 80 percent of its ATR range, new
entries in the direction of the move carry materially higher risk.
7. ATR Percentile below 20 and Contraction regime together may signal
a low-volatility setup ahead of a potential expansion move.
ATR Percentile above 80 and Expansion regime suggest the period is
already in an impulsive phase.
8. The Timeframe Warning label appears automatically when you have
zones enabled for a timeframe that is equal to or lower than your
chart timeframe. This is a safety reminder and does not affect
calculations.
NOTES
This indicator is for analytical and educational purposes only. It
does not generate buy or sell signals. All trading decisions are the
sole responsibility of the trader.
ATR-based zones represent historical volatility ranges. Past
volatility does not predict future price movement within those ranges.
The Rogers-Satchell and Yang-Zhang formulas use OHLC data from the
higher timeframe bars. On instruments with insufficient OHLC data
(for example, some synthetic or derived instruments), the Dante Wilder
method is recommended.
═══════════════════════════════════════════════════════════
TAGS:
ATR, volatility, fibonacci, levels, multi-timeframe, weekly,
monthly, quarterly, support-resistance, swing-trading,
yang-zhang, rogers-satchell, range, zones
═══════════════════════════════════════════════════════════
═══════════════════════════════════════════════════════════
CATEGORIES (select at least one):
- Volatility
- Support / Resistance
- Multi-timeframe analysis
═══════════════════════════════════════════════════════════
DESCRIPTION
═══════════════════════════════════════════════════════════
ATR Static Zones plots volatility-based price zones and Fibonacci
levels for four timeframes simultaneously — Daily, Weekly, Monthly,
and Quarterly — on any intraday or higher chart timeframe.
Each zone is anchored to the previous period close or the current
period open, depending on the selected method and anchor mode. The
anchor and ATR value are locked at the start of each new period and
do not shift during the period, giving static reference levels that
remain in place as price moves.
The key differentiator of this script is the choice of four ATR
calculation formulas, each suited to different market conditions.
ATR FORMULAS
Dante (Wilder RMA) — the original Wilder smoothed ATR using a
running moving average. Anchor is the previous period close. This is
the standard method used by most traders and platforms.
Dante (Open) — same Wilder ATR formula, but the anchor is set to the
opening price of the current period instead of the prior close. Useful
when the period open is more significant than the prior close, for
example when gaps are common.
Rogers-Satchell — a volatility estimator based on all four OHLC
prices within each period bar. It uses the formula:
sigma squared = ln(H/C) x ln(H/O) + ln(L/C) x ln(L/O).
This method accounts for intraperiod trending and produces a lower
bias than close-to-close methods. It does not account for overnight
gaps between periods.
Yang-Zhang — the most accurate OHLC estimator. It combines the
overnight component (open vs. prior close), the open-to-close
component, and the Rogers-Satchell estimator with an optimal
weighting coefficient k. This method handles both intraperiod trends
and overnight gaps, producing minimum variance estimates. It is
recommended for instruments that gap frequently, such as futures,
stocks, or crypto across sessions.
All four formulas are applied using the same ATR period setting and
produce output in price units so zone levels are directly usable on
any chart.
ANCHOR MODE
Static (default) — the anchor and ATR are calculated once at the
start of each new period and held fixed until the next period begins.
Zone levels do not move as price action develops during the period.
Dynamic — the anchor and ATR are recalculated on every bar using live
HTF data. Useful for seeing how zones would shift if the period closed
at the current price. The zone levels will move during the period.
TIMEFRAMES
Each of the four timeframes — Daily, Weekly, Monthly, Quarterly — can
be independently enabled or disabled. Fibonacci levels can also be
toggled per timeframe separately from the zone bands. A warning label
appears automatically if the chart timeframe is equal to or higher
than a selected calculation timeframe, since in that case the zones
would not provide useful sub-period reference.
FIBONACCI LEVELS
When Fibonacci levels are enabled for a timeframe, the following
levels are drawn symmetrically above and below the anchor using the
period ATR as the unit of measurement:
Anchor (previous close) — midpoint
+/- 23.6% — call and put trigger zones
+/- 38.2% — intermediate level
+/- 50.0% — half-ATR from anchor
+/- 61.8% — key target level
+/- 78.6% — deep retracement
+/- 100% — full ATR zone boundaries
+/- 123.6% — extension
+/- 138.2% — extension
+/- 161.8% — extension
+/- 200% — double ATR extension
Each level can be individually toggled. The line style (solid, dashed,
dotted) and line width are adjustable. Each level has its own color
setting. Text labels showing the level percentage and price appear at
the right end of each Fibonacci line.
Fibonacci lines are anchored to the first bar of each period (x1) and
their right endpoint (x2) is extended to the current bar on every
update. They do not extend to infinity.
VOLATILITY ANALYTICS
The info table includes a set of volatility metrics for each
timeframe, providing context beyond the raw ATR value:
ATR Percentile — shows where the current ATR stands relative to the
last N periods (default 52). A reading of 0 percent means the ATR is
at a historical low for the lookback window. A reading of 100 percent
means it is at a historical high. This helps identify whether
volatility is compressed or expanded.
Volatility Regime — automatically classifies the current environment
as Low, Normal, High, or Extreme based on the ATR Percentile. This
gives an immediate qualitative read on market conditions.
ATR Expansion / Contraction — compares the current ATR to an EMA of
ATR over a configurable period. When ATR is above its EMA, the label
shows Expansion (impulse conditions). When ATR is below its EMA, it
shows Contraction (accumulation or consolidation conditions).
Expected Move — shows how much of the period ATR range has not yet
been consumed. Calculated as (ATR minus current period high-low range)
expressed as a percentage. When this value approaches zero, the
expected range for the period has been largely used up.
ATR Delta — shows the percentage change in ATR compared to the
previous period. A sharp positive delta indicates a sudden increase
in volatility. A negative delta indicates that conditions are calming
relative to the prior period.
Range Utilization — shows (high minus low of the current period)
divided by ATR, expressed as a percentage. Color coding in the table
cell gives an immediate read: green for under 50 percent, yellow for
50 to 80 percent, red for over 80 percent.
INFO TABLE
The info table displays all analytics for all four timeframes in one
place. Columns: ATR value, Range Utilization, ATR Percentile,
Volatility Regime, Expansion/Contraction, Expected Move, ATR Delta.
Below the period rows, the table shows anchors for Weekly, Monthly,
and Quarterly, Fibonacci trigger levels for the current week, the
active ATR method, and the anchor mode.
Table position can be set to any of the four screen corners.
Table text size is adjustable: Small, Normal, or Large.
ZONE HIGHLIGHTING
Barcolor highlighting is available as an optional toggle. When enabled,
candles that close above the upper ATR zone are highlighted in the
upper zone color, and candles that close below the lower ATR zone are
highlighted in the lower zone color. This makes breakouts immediately
visible without needing to watch price relative to the zone bands.
ALERTS (14 conditions)
Weekly ATR upper zone breakout
Weekly ATR lower zone breakout
Monthly ATR upper zone breakout
Monthly ATR lower zone breakout
Quarterly ATR upper zone breakout
Quarterly ATR lower zone breakout
Weekly +23.6% (call trigger) crossover upward
Weekly -23.6% (put trigger) crossunder downward
Weekly +61.8% (key level) crossover upward
Weekly -61.8% (key level) crossunder downward
Daily +23.6% crossover upward
Daily -23.6% crossunder downward
Daily +61.8% crossover upward
Daily -61.8% crossunder downward
HOW TO USE
1. Add the indicator to any intraday or daily chart. Weekly and
Monthly timeframes are most useful on timeframes from 1 hour down
to 5 minutes.
2. Select the ATR formula. For most equity and crypto markets, Yang-
Zhang produces the most accurate zone placement because it accounts
for gaps between sessions. For forex with nearly continuous trading,
Rogers-Satchell or Dante Wilder are typically sufficient.
3. Leave anchor mode on Static for reference trading. This gives
stable, non-moving zones for the duration of each period. Switch to
Dynamic only for exploratory analysis.
4. The anchor line (dotted) marks the previous close — the neutral
reference. Price above the anchor within the weekly period
generally indicates strength. Price below indicates weakness.
5. The +/-23.6% levels are early entry trigger zones. The +/-61.8%
levels are key retracement areas with higher statistical
significance. The +/-100% levels (zone bands) mark the statistical
full-range boundary.
6. Use Range Utilization to assess remaining potential. If a period
has already consumed more than 80 percent of its ATR range, new
entries in the direction of the move carry materially higher risk.
7. ATR Percentile below 20 and Contraction regime together may signal
a low-volatility setup ahead of a potential expansion move.
ATR Percentile above 80 and Expansion regime suggest the period is
already in an impulsive phase.
8. The Timeframe Warning label appears automatically when you have
zones enabled for a timeframe that is equal to or lower than your
chart timeframe. This is a safety reminder and does not affect
calculations.
NOTES
This indicator is for analytical and educational purposes only. It
does not generate buy or sell signals. All trading decisions are the
sole responsibility of the trader.
ATR-based zones represent historical volatility ranges. Past
volatility does not predict future price movement within those ranges.
The Rogers-Satchell and Yang-Zhang formulas use OHLC data from the
higher timeframe bars. On instruments with insufficient OHLC data
(for example, some synthetic or derived instruments), the Dante Wilder
method is recommended.
═══════════════════════════════════════════════════════════
TAGS:
ATR, volatility, fibonacci, levels, multi-timeframe, weekly,
monthly, quarterly, support-resistance, swing-trading,
yang-zhang, rogers-satchell, range, zones
═══════════════════════════════════════════════════════════
═══════════════════════════════════════════════════════════
CATEGORIES (select at least one):
- Volatility
- Support / Resistance
- Multi-timeframe analysis
═══════════════════════════════════════════════════════════
Release Notes
Release notes — ATR Static Zones D/W/M/Q v4Added
Parkinson as a fifth ATR calculation method, available in the Method dropdown alongside the existing four options
ATR% column in the info table showing ATR as a percentage of price, comparable across any instrument. Toggleable in Volatility settings
Fixed
Price labels and all table values now display the correct number of decimal places on any instrument, including JPY futures, micro forex, and crypto
Yang-Zhang weighting coefficient now recalculates correctly for any ATR period length, not just the default 14
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Практикующий трейдер на финансовых рынках с 2013 года. Автор стратегии "VOTrade" -t.me/VOTradeGroup
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Практикующий трейдер на финансовых рынках с 2013 года. Автор стратегии "VOTrade" -t.me/VOTradeGroup
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.