OPEN-SOURCE SCRIPT
מעודכן Fixed Range / Donchian Channel with price projections

## Fixed Range / Donchian Channel
A versatile channel indicator combining traditional Donchian Channels with adaptive fixed-range logic.
This tool is designed to help traders visualise structured price movement using either:
* Dynamic Donchian breakout ranges, or
* Fixed-width channels that remain level until price forces a reset.
Unlike standard volatility bands that continuously expand and contract every bar, the Fixed Range mode creates stable price zones that only shift when price exceeds the current boundary. This produces cleaner structure and makes recurring market ranges easier to identify.
### Features
* Fixed Range mode using:
* Points
* Percentage
* ATR
* Traditional Donchian Channel mode
* Locked ATR logic:
* ATR is calculated only when the channel resets
* Prevents band distortion and keeps channel widths stable
* Midline and quarter divisions
* Configurable extension levels
* Clean visual structure suitable for trend and range analysis
### How It Works
#### Fixed Range Mode
The channel maintains a constant width until price breaks either the upper or lower boundary.
When a breakout occurs:
* The channel resets from the breakout point
* A new fixed range is calculated
* The new range remains locked until the next reset
This creates staircase-like market structure that can help identify:
* Trend continuation
* Volatility expansion
* Recurring price intervals
* Structured pullbacks
#### ATR Mode
Most ATR-based indicators recalculate every bar, causing channel widths to constantly fluctuate.
This script uses a different approach:
* ATR is only recalculated during a reset event
* The channel width then remains fixed
* Produces cleaner and more level price structures
This makes ATR behave more like a true structural range rather than a continuously moving volatility envelope.
### Suggested Usage
Market behaviour is fractal in nature. Prices often move in repeating ranges and waves within waves.
Examples commonly observed:
* Forex intraday:
* 10, 20, 50, 100 pip movements
* 0.2%, 0.5%, 1% ranges
* Indices such as SPX:
* 3%, 5%, 10% swings on higher timeframes
This indicator helps visualise these recurring structures across multiple scales.
Many traders may find it useful for:
* Trend structure analysis
* Pullback zones
* Breakout continuation
* Mean reversion areas
* Multi-timeframe market mapping
### Power tip
With the fixed range option you can use the standard Tradingview fib extension with ease. Just set it once for the range and then just keep dragging it to new levels
Swith off the extension lines if you go for this method
### Notes
* Fixed Range mode is intentionally non-reactive between resets.
* ATR mode behaves differently from standard ATR bands by design.
* Donchian mode functions as a traditional rolling highest/lowest channel.
A versatile channel indicator combining traditional Donchian Channels with adaptive fixed-range logic.
This tool is designed to help traders visualise structured price movement using either:
* Dynamic Donchian breakout ranges, or
* Fixed-width channels that remain level until price forces a reset.
Unlike standard volatility bands that continuously expand and contract every bar, the Fixed Range mode creates stable price zones that only shift when price exceeds the current boundary. This produces cleaner structure and makes recurring market ranges easier to identify.
### Features
* Fixed Range mode using:
* Points
* Percentage
* ATR
* Traditional Donchian Channel mode
* Locked ATR logic:
* ATR is calculated only when the channel resets
* Prevents band distortion and keeps channel widths stable
* Midline and quarter divisions
* Configurable extension levels
* Clean visual structure suitable for trend and range analysis
### How It Works
#### Fixed Range Mode
The channel maintains a constant width until price breaks either the upper or lower boundary.
When a breakout occurs:
* The channel resets from the breakout point
* A new fixed range is calculated
* The new range remains locked until the next reset
This creates staircase-like market structure that can help identify:
* Trend continuation
* Volatility expansion
* Recurring price intervals
* Structured pullbacks
#### ATR Mode
Most ATR-based indicators recalculate every bar, causing channel widths to constantly fluctuate.
This script uses a different approach:
* ATR is only recalculated during a reset event
* The channel width then remains fixed
* Produces cleaner and more level price structures
This makes ATR behave more like a true structural range rather than a continuously moving volatility envelope.
### Suggested Usage
Market behaviour is fractal in nature. Prices often move in repeating ranges and waves within waves.
Examples commonly observed:
* Forex intraday:
* 10, 20, 50, 100 pip movements
* 0.2%, 0.5%, 1% ranges
* Indices such as SPX:
* 3%, 5%, 10% swings on higher timeframes
This indicator helps visualise these recurring structures across multiple scales.
Many traders may find it useful for:
* Trend structure analysis
* Pullback zones
* Breakout continuation
* Mean reversion areas
* Multi-timeframe market mapping
### Power tip
With the fixed range option you can use the standard Tradingview fib extension with ease. Just set it once for the range and then just keep dragging it to new levels
Swith off the extension lines if you go for this method
### Notes
* Fixed Range mode is intentionally non-reactive between resets.
* ATR mode behaves differently from standard ATR bands by design.
* Donchian mode functions as a traditional rolling highest/lowest channel.
הערות שחרור
Added an option to plot lines at an interval of 1/8 of the width. This useful when selecting large rangesסקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.