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-/
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。