OPEN-SOURCE SCRIPT
Aggiornato Donchian Squeeze Oscillator

# Donchian Squeeze Oscillator (DSO) - User Guide
## Overview
The Donchian Squeeze Oscillator is a technical indicator designed to identify periods of low volatility (squeeze) and high volatility (expansion) in financial markets by measuring the distance between Donchian Channel bands. The indicator normalizes this measurement to a 0-100 scale, making it easy to interpret across different timeframes and instruments.
## How It Works
The DSO calculates the width of Donchian Channels as a percentage of the middle line, smooths this data, and then normalizes it using historical highs and lows over a specified lookback period. The result is inverted so that:
- **High values (80+)** = Narrow channels = Low volatility = Squeeze
- **Low values (20-)** = Wide channels = High volatility = Expansion
## Key Parameters
### Core Settings
- **Donchian Channel Period (20)**: The number of bars used to calculate the highest high and lowest low for the Donchian Channels
- **Smoothing Period (5)**: Applies moving average smoothing to reduce noise in the oscillator
- **Normalization Lookback (200)**: Historical period used to normalize the oscillator between 0-100
### Threshold Levels
- **Over Squeeze (80)**: Values above this level indicate strong squeeze conditions
- **Over Expansion (20)**: Values below this level indicate strong expansion conditions
## Reading the Indicator
### Color Coding
- **Red Line**: Squeeze condition (above 80 threshold) - Markets are consolidating
- **Orange Line**: Neutral/trending condition with upward momentum
- **Green Line**: Expansion condition or downward momentum
### Visual Elements
- **Red Dashed Line (80)**: Squeeze threshold - potential breakout zone
- **Gray Dotted Line (50)**: Middle line - neutral zone
- **Green Dashed Line (20)**: Expansion threshold - high volatility zone
- **Red Background**: Highlights active squeeze periods
## Trading Applications
### 1. Breakout Trading
- **Setup**: Wait for DSO to reach 80+ (squeeze zone)
- **Entry**: Look for breakouts when DSO starts declining from squeeze levels
- **Logic**: Prolonged low volatility often precedes significant price movements
### 2. Volatility Cycle Trading
- **Squeeze Phase**: DSO > 80 - Prepare for potential breakout
- **Breakout Phase**: DSO declining from 80 - Trade the direction of breakout
- **Expansion Phase**: DSO < 20 - Expect trend continuation or reversal
### 3. Trend Confirmation
- **Orange Color**: Suggests bullish momentum during expansion
- **Green Color**: Suggests bearish momentum or consolidation
- Use in conjunction with price action for trend confirmation
## Best Practices
### Timeframe Selection
- **Higher Timeframes (Daily, 4H)**: More reliable signals, fewer false breakouts
- **Lower Timeframes (1H, 15M)**: More frequent signals but higher noise
- **Multi-timeframe Analysis**: Confirm squeeze on higher TF, enter on lower TF
### Parameter Optimization
- **Volatile Markets**: Increase Donchian period (25-30) and smoothing (7-10)
- **Range-bound Markets**: Decrease Donchian period (15-20) for more sensitivity
- **Trending Markets**: Use longer normalization lookback (300-400)
### Signal Confirmation
Always combine DSO signals with:
- **Price Action**: Support/resistance levels, chart patterns
- **Volume**: Confirm breakouts with increasing volume
- **Other Indicators**: RSI, MACD, or momentum oscillators
## Alert System
The indicator includes built-in alerts for:
- **Squeeze Started**: When DSO crosses above the squeeze threshold
- **Expansion Started**: When DSO crosses below the expansion threshold
## Common Pitfalls to Avoid
1. **False Breakouts**: Don't trade every squeeze - wait for confirmation
2. **Parameter Over-optimization**: Stick to default settings initially
3. **Ignoring Market Context**: Consider overall market conditions and news
4. **Single Indicator Reliance**: Always use additional confirmation tools
## Advanced Tips
- Monitor squeeze duration - longer squeezes often lead to bigger moves
- Look for squeeze patterns at key support/resistance levels
- Use DSO divergences with price for potential reversal signals
- Combine with Bollinger Band squeezes for enhanced accuracy
## Conclusion
The Donchian Squeeze Oscillator is a powerful tool for identifying volatility cycles and potential breakout opportunities. Like all technical indicators, it should be used as part of a comprehensive trading strategy rather than as a standalone signal generator. Practice with the indicator on historical data before implementing it in live trading to understand its behavior in different market conditions.
## Overview
The Donchian Squeeze Oscillator is a technical indicator designed to identify periods of low volatility (squeeze) and high volatility (expansion) in financial markets by measuring the distance between Donchian Channel bands. The indicator normalizes this measurement to a 0-100 scale, making it easy to interpret across different timeframes and instruments.
## How It Works
The DSO calculates the width of Donchian Channels as a percentage of the middle line, smooths this data, and then normalizes it using historical highs and lows over a specified lookback period. The result is inverted so that:
- **High values (80+)** = Narrow channels = Low volatility = Squeeze
- **Low values (20-)** = Wide channels = High volatility = Expansion
## Key Parameters
### Core Settings
- **Donchian Channel Period (20)**: The number of bars used to calculate the highest high and lowest low for the Donchian Channels
- **Smoothing Period (5)**: Applies moving average smoothing to reduce noise in the oscillator
- **Normalization Lookback (200)**: Historical period used to normalize the oscillator between 0-100
### Threshold Levels
- **Over Squeeze (80)**: Values above this level indicate strong squeeze conditions
- **Over Expansion (20)**: Values below this level indicate strong expansion conditions
## Reading the Indicator
### Color Coding
- **Red Line**: Squeeze condition (above 80 threshold) - Markets are consolidating
- **Orange Line**: Neutral/trending condition with upward momentum
- **Green Line**: Expansion condition or downward momentum
### Visual Elements
- **Red Dashed Line (80)**: Squeeze threshold - potential breakout zone
- **Gray Dotted Line (50)**: Middle line - neutral zone
- **Green Dashed Line (20)**: Expansion threshold - high volatility zone
- **Red Background**: Highlights active squeeze periods
## Trading Applications
### 1. Breakout Trading
- **Setup**: Wait for DSO to reach 80+ (squeeze zone)
- **Entry**: Look for breakouts when DSO starts declining from squeeze levels
- **Logic**: Prolonged low volatility often precedes significant price movements
### 2. Volatility Cycle Trading
- **Squeeze Phase**: DSO > 80 - Prepare for potential breakout
- **Breakout Phase**: DSO declining from 80 - Trade the direction of breakout
- **Expansion Phase**: DSO < 20 - Expect trend continuation or reversal
### 3. Trend Confirmation
- **Orange Color**: Suggests bullish momentum during expansion
- **Green Color**: Suggests bearish momentum or consolidation
- Use in conjunction with price action for trend confirmation
## Best Practices
### Timeframe Selection
- **Higher Timeframes (Daily, 4H)**: More reliable signals, fewer false breakouts
- **Lower Timeframes (1H, 15M)**: More frequent signals but higher noise
- **Multi-timeframe Analysis**: Confirm squeeze on higher TF, enter on lower TF
### Parameter Optimization
- **Volatile Markets**: Increase Donchian period (25-30) and smoothing (7-10)
- **Range-bound Markets**: Decrease Donchian period (15-20) for more sensitivity
- **Trending Markets**: Use longer normalization lookback (300-400)
### Signal Confirmation
Always combine DSO signals with:
- **Price Action**: Support/resistance levels, chart patterns
- **Volume**: Confirm breakouts with increasing volume
- **Other Indicators**: RSI, MACD, or momentum oscillators
## Alert System
The indicator includes built-in alerts for:
- **Squeeze Started**: When DSO crosses above the squeeze threshold
- **Expansion Started**: When DSO crosses below the expansion threshold
## Common Pitfalls to Avoid
1. **False Breakouts**: Don't trade every squeeze - wait for confirmation
2. **Parameter Over-optimization**: Stick to default settings initially
3. **Ignoring Market Context**: Consider overall market conditions and news
4. **Single Indicator Reliance**: Always use additional confirmation tools
## Advanced Tips
- Monitor squeeze duration - longer squeezes often lead to bigger moves
- Look for squeeze patterns at key support/resistance levels
- Use DSO divergences with price for potential reversal signals
- Combine with Bollinger Band squeezes for enhanced accuracy
## Conclusion
The Donchian Squeeze Oscillator is a powerful tool for identifying volatility cycles and potential breakout opportunities. Like all technical indicators, it should be used as part of a comprehensive trading strategy rather than as a standalone signal generator. Practice with the indicator on historical data before implementing it in live trading to understand its behavior in different market conditions.
Note di rilascio
graphics updateScript open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.