OPEN-SOURCE SCRIPT
Drawdown %

Drawdown % — Real-Time Peak-to-Trough Analysis
This indicator provides a precise, real-time measure of drawdown as a percentage from the running peak of any source series. Unlike equity curve tools tied to strategy backtests, this is a pure price-based indicator compatible with any instrument and timeframe — no strategy execution required.
How it works
On each bar, the indicator tracks the highest observed value of the selected source (default: close). Drawdown is then calculated as the percentage decline from that running peak to the current value. The maximum drawdown — the deepest peak-to-trough decline observed across the entire chart history — is computed continuously and plotted as a persistent reference line.
Visual features
Area plot — the current drawdown curve fills dynamically, shifting from muted red to orange to solid red as losses breach the −5% and −10% thresholds
Max drawdown line — a persistent maroon line marking the worst historical decline
Reference levels — dashed horizontal lines at 0%, −5%, −10%, and −20% for quick visual orientation
Info table — a top-right overlay displaying current drawdown and maximum drawdown in real time, color-coded by severity
How to use it
Apply the indicator to any chart as a standalone pane. The source input defaults to close price but can be changed to open, high, low, HL2, or any other available source. Use the reference levels and table readout to monitor risk exposure, identify periods of sustained drawdown, and compare current conditions against the historical worst-case decline.
Compatibility
Pine Script v6 — works on all asset classes and timeframes.
© Babayaga-
profile link: in.tradingview.com/u/Babayaga-/
This indicator provides a precise, real-time measure of drawdown as a percentage from the running peak of any source series. Unlike equity curve tools tied to strategy backtests, this is a pure price-based indicator compatible with any instrument and timeframe — no strategy execution required.
How it works
On each bar, the indicator tracks the highest observed value of the selected source (default: close). Drawdown is then calculated as the percentage decline from that running peak to the current value. The maximum drawdown — the deepest peak-to-trough decline observed across the entire chart history — is computed continuously and plotted as a persistent reference line.
Visual features
Area plot — the current drawdown curve fills dynamically, shifting from muted red to orange to solid red as losses breach the −5% and −10% thresholds
Max drawdown line — a persistent maroon line marking the worst historical decline
Reference levels — dashed horizontal lines at 0%, −5%, −10%, and −20% for quick visual orientation
Info table — a top-right overlay displaying current drawdown and maximum drawdown in real time, color-coded by severity
How to use it
Apply the indicator to any chart as a standalone pane. The source input defaults to close price but can be changed to open, high, low, HL2, or any other available source. Use the reference levels and table readout to monitor risk exposure, identify periods of sustained drawdown, and compare current conditions against the historical worst-case decline.
Compatibility
Pine Script v6 — works on all asset classes and timeframes.
© Babayaga-
profile link: in.tradingview.com/u/Babayaga-/
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.