OPEN-SOURCE SCRIPT
McGinley Dynamic debugged

🔍 McGinley Dynamic Debugged (Adaptive Moving Average)
This indicator plots the McGinley Dynamic, a mathematically adaptive moving average designed to reduce lag and better track price action during both trends and consolidations.
✅ Key Features:
Adaptive smoothing: The McGinley Dynamic adjusts itself based on the speed of price changes.
Lag reduction: Compared to traditional moving averages like EMA or SMA, McGinley provides smoother yet responsive tracking.
Stability fix: This version includes a robust fix for rare recursive calculation issues, particularly on low-priced historical assets (e.g., Wipro pre-2000).
⚙️ What’s Different in This Debugged Version?
Implements manual clamping on the source / previous value ratio to prevent mathematical spikes that could cause flattening or distortion in the plotted line.
Ensures more stable behavior across all instruments and timeframes, especially those with historically low price points or volatile early data.
💡 Use Case:
Ideal for:
Trend confirmation
Entry filtering
Adaptive support/resistance visualization
Improving signal precision in low-volatility or high-noise environments
⚠️ Notes:
Works best when combined with volume filters or other trend indicators for validation.
This version is optimized for visual use—for signal generation, consider pairing it with additional logic or thresholds.
This indicator plots the McGinley Dynamic, a mathematically adaptive moving average designed to reduce lag and better track price action during both trends and consolidations.
✅ Key Features:
Adaptive smoothing: The McGinley Dynamic adjusts itself based on the speed of price changes.
Lag reduction: Compared to traditional moving averages like EMA or SMA, McGinley provides smoother yet responsive tracking.
Stability fix: This version includes a robust fix for rare recursive calculation issues, particularly on low-priced historical assets (e.g., Wipro pre-2000).
⚙️ What’s Different in This Debugged Version?
Implements manual clamping on the source / previous value ratio to prevent mathematical spikes that could cause flattening or distortion in the plotted line.
Ensures more stable behavior across all instruments and timeframes, especially those with historically low price points or volatile early data.
💡 Use Case:
Ideal for:
Trend confirmation
Entry filtering
Adaptive support/resistance visualization
Improving signal precision in low-volatility or high-noise environments
⚠️ Notes:
Works best when combined with volume filters or other trend indicators for validation.
This version is optimized for visual use—for signal generation, consider pairing it with additional logic or thresholds.
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.
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.