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-/
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.