What Drawdown Monitor does
Drawdown Monitor is a free indicator by DinexSpace for MT5 and TradingView. Tracks drawdown from the peak: price drawdown on TradingView, account drawdown on MT5.

MT5 version
Drawdown Monitor keeps an eye on your account and tells you how deep the current drawdown is. Its alerts fire before a bad day turns into a worse one.
TradingView version
Drawdown Monitor shows how far price is below its last peak, in percent. The line sits at 0% when price makes a new high and goes negative while price is "under water". This gives a quick sense of how deep the current decline is compared with past declines on the same chart.
When to use it
Use it to know when to cut your position size.
Features and modes
Drawdown Monitor has 9 documented features, listed below.
MT5 version
How it works
- DD from peak: how far equity is below its highest value. The peak is stored in a terminal global variable per account, so it survives restarts. It can be reset with an input.
- Floating DD: how far equity is below balance, which is the loss on open positions.
- Today DD: how far equity is below the equity at the start of the server day.
- Each value is shown in a small panel and coloured by the warning level it has reached.
- The panel updates every second, even when the chart symbol has no new ticks.
TradingView version
How it works
- The peak is either the highest value in the loaded history (all-time mode) or the highest value of the last N bars (rolling mode). You can measure it from highs or from closes.
- Drawdown = close / peak − 1, plotted in a separate pane with a shaded area while under water.
- Three dashed warning levels (−10%, −20% and −30% by default) mark the depths you care about. A small dot marks each return to a new peak.
- A stats table shows the peak price and date, the drawdown now, the deepest drawdown in the same window and the days since the peak.
Parameters
Drawdown Monitor has 11 inputs in the MT5 version and 11 in the TradingView version; every input and its default is listed below.
MT5 version
- Warning levels: three percentages and which drawdown to watch.
- Alerts: pop-up, push, sound.
- Peak: reset the stored equity peak on start.
- Display: font size, panel corner.
TradingView version
- Peak: all-time or rolling, N bars, from high or close.
- Warning levels: three levels, each with its own colour.
- Display: line colours, fill on/off, table on/off and its position.
| Input | Default | Label in MT5 |
|---|---|---|
| Warning levels (% drawdown) | ||
InpLevel1 | 3.0 | Level 1 |
InpLevel2 | 5.0 | Level 2 |
InpLevel3 | 10.0 | Level 3 |
InpAlertOn | DD_FROM_PEAK | Alert on |
| Alerts | ||
InpPopup | true | Pop-up alert |
InpPush | false | Push notification (MetaQuotes ID set in terminal) |
InpSound | false | Sound |
| Peak | ||
InpResetPeak | false | Reset stored equity peak on start |
| Display | ||
InpFont | 9 | Font size |
InpCorner | CORNER_LEFT_UPPER | Panel corner |
InpShowAcc | false | Show the account number (off: safe to share screenshots) |
| Input | Default |
|---|---|
| Peak | |
| Peak | "All-time (loaded history)" |
| N bars (rolling) | 252 |
| Peak from | "High" |
| Warning levels (%) | |
| Level 1 | -10.0 |
| Level 2 | -20.0 |
| Level 3 | -30.0 |
| Display | |
| Drawdown line | C_AQUA |
| At peak | C_GREEN |
| Fill under water | true |
| Stats table | true |
| Table position | "Top right" |
Signals
The free version of Drawdown Monitor has no separate buy/sell signal system with SL and TP; it marks the chart as described under Features, and you decide how to trade it.
Alerts
Yes. Drawdown Monitor has built-in alerts: MT5 – pop-up, push notification, sound; TradingView – alert conditions for Create Alert.
MT5 version
- You set three warning levels (3%, 5% and 10% by default) and choose which drawdown they watch. Each level alerts once: by pop-up, push notification (MetaQuotes ID set in the terminal) and/or sound. A level re-arms after the drawdown recovers to half of it, and every level re-arms at the start of each day.
TradingView version
"Drawdown below level 1/2/3" fires when the drawdown crosses below a level. "New peak" fires when price recovers to a new peak.
Buffers for Expert Advisors
No. Drawdown Monitor draws chart objects (lines, boxes, labels or a panel) and has no indicator buffers for EAs.
Timeframes and markets
Drawdown Monitor sets no timeframe limit in its code: it runs on any chart timeframe and on the symbol of the chart it is attached to.
Limitations
Drawdown Monitor is an analysis tool, not a trading system. Its documented limitations are listed below.
MT5 version
- The peak is only known from the moment the indicator first runs on the account. Earlier history is not read.
- Deposits and withdrawals change equity and therefore the drawdown figures.
- The day follows the broker's server time.
The indicator only monitors and alerts. It never closes, opens or changes positions or orders, and uses no DLLs or web requests.
TradingView version
- All-time mode only sees the history loaded on the chart. On a short history the peak may not be the true all-time high.
- Values on the current bar change until the bar closes. Use bar-close alerts if you want confirmed values.
- It measures price, not the equity of a strategy or an account.
This script is an analysis aid only. It does not give trade signals or investment advice.
Pine Script code
Paste the whole script into the Pine Editor on TradingView.
drawdown_monitor.pine · 100 lines//@version=6
// DinexSpace | Drawdown Monitor
// Plots how far price is below its last peak, in percent, in a separate pane: 0% at a new high, negative
// while price is "under water". Marks warning levels, shows the deepest drawdown and the time since the
// peak, and can alert when a level is broken or when price makes a new peak.
// The peak is the all-time high of the loaded history or the highest value of the last N bars.
// Free and open source. License: MIT. (c) 2026 DinexSpace
indicator("DinexSpace | Drawdown Monitor", shorttitle = "DNX Drawdown", overlay = false, format = format.percent, precision = 2)
// ===== Brand colours =====
C_GREEN = #00FF7F // SpringGreen
C_AQUA = #00FFFF // Aqua
C_AMBER = #FFB000
C_RED = #FF4D6A
C_GRAY = #9AA0A6
// ===== Inputs: peak =====
GRP_P = "Peak"
pkMode = input.string("All-time (loaded history)", "Peak", options = ["All-time (loaded history)", "Rolling N bars"], group = GRP_P)
pkLen = input.int(252, "N bars (rolling)", minval = 2, maxval = 5000, group = GRP_P)
pkSrc = input.string("High", "Peak from", options = ["High", "Close"], group = GRP_P)
// ===== Inputs: levels =====
GRP_L = "Warning levels (%)"
lv1 = input.float(-10.0, "Level 1", maxval = 0, step = 1, inline = "l1", group = GRP_L)
col1 = input.color(C_AMBER, "", inline = "l1", group = GRP_L)
lv2 = input.float(-20.0, "Level 2", maxval = 0, step = 1, inline = "l2", group = GRP_L)
col2 = input.color(color.orange, "", inline = "l2", group = GRP_L)
lv3 = input.float(-30.0, "Level 3", maxval = 0, step = 1, inline = "l3", group = GRP_L)
col3 = input.color(C_RED, "", inline = "l3", group = GRP_L)
// ===== Inputs: display =====
GRP_D = "Display"
colDD = input.color(C_AQUA, "Drawdown line", inline = "d", group = GRP_D)
colTop = input.color(C_GREEN, "At peak", inline = "d", group = GRP_D)
showFil = input.bool(true, "Fill under water", group = GRP_D)
showTbl = input.bool(true, "Stats table", group = GRP_D)
tblPos = input.string("Top right", "Table position", options = ["Top right", "Top left", "Bottom right", "Bottom left"], group = GRP_D)
// ===== Peak and drawdown (uses only the current and past bars) =====
float src = pkSrc == "High" ? high : close
bool rolling = pkMode == "Rolling N bars"
var float athPeak = na
var int athTime = na
if na(athPeak) or src >= athPeak
athPeak := src
athTime := time
float rollPeak = ta.highest(src, pkLen)
int rollOff = ta.highestbars(src, pkLen) // 0 or negative: bars back to the peak
float peak = rolling ? rollPeak : athPeak
int peakTime = rolling ? (na(rollOff) ? na : time[-rollOff]) : athTime
float dd = na(peak) ? na : (close / peak - 1) * 100
// Deepest drawdown over the same window as the peak.
var float athMin = na
athMin := na(dd) ? athMin : na(athMin) ? dd : math.min(athMin, dd)
float maxDD = rolling ? ta.lowest(dd, pkLen) : athMin
bool atPeak = not na(dd) and dd >= -0.0001
// ===== Plots =====
p0 = plot(0, "Zero", color = color.new(C_GRAY, 60), display = display.pane)
pd = plot(dd, "Drawdown %", color = atPeak ? colTop : colDD, linewidth = 2)
fill(p0, pd, color = showFil ? color.new(colDD, 82) : na, title = "Under water")
hline(lv1, "Level 1", color = col1, linestyle = hline.style_dashed)
hline(lv2, "Level 2", color = col2, linestyle = hline.style_dashed)
hline(lv3, "Level 3", color = col3, linestyle = hline.style_dashed)
plotshape(atPeak and not atPeak[1] ? 0 : na, "New peak", shape.circle, location.absolute, colTop, size = size.tiny)
// ===== Alerts =====
alertcondition(ta.crossunder(dd, lv1), "Drawdown below level 1", "{{ticker}} drawdown fell below level 1")
alertcondition(ta.crossunder(dd, lv2), "Drawdown below level 2", "{{ticker}} drawdown fell below level 2")
alertcondition(ta.crossunder(dd, lv3), "Drawdown below level 3", "{{ticker}} drawdown fell below level 3")
alertcondition(atPeak and not atPeak[1], "New peak", "{{ticker}} made a new peak (drawdown back to 0%)")
// ===== Stats table =====
tPos = switch tblPos
"Top left" => position.top_left
"Bottom right" => position.bottom_right
"Bottom left" => position.bottom_left
=> position.top_right
var table tbl = table.new(tPos, 2, 6, bgcolor = color.new(color.black, 10), border_color = color.new(color.gray, 70), border_width = 1)
cell(int r, string name, string val, color col) =>
table.cell(tbl, 0, r, name, text_color = color.gray, text_size = size.small, text_halign = text.align_left)
table.cell(tbl, 1, r, val, text_color = col, text_size = size.small, text_halign = text.align_right)
if showTbl and barstate.islast
float days = na(peakTime) ? na : (time - peakTime) / 86400000.0
color ddCol = dd <= lv3 ? col3 : dd <= lv2 ? col2 : dd <= lv1 ? col1 : atPeak ? colTop : colDD
cell(0, "Peak", na(peak) ? "-" : str.tostring(peak, format.mintick), color.white)
cell(1, "Peak date", na(peakTime) ? "-" : str.format_time(peakTime, "yyyy-MM-dd", syminfo.timezone), color.white)
cell(2, "Drawdown now", na(dd) ? "-" : str.tostring(dd, "0.00") + "%", ddCol)
cell(3, "Deepest", na(maxDD) ? "-" : str.tostring(maxDD, "0.00") + "%", color.white)
cell(4, "Days since peak", na(days) ? "-" : str.tostring(days, "0.0"), color.white)
table.cell(tbl, 0, 5, "DinexSpace", text_color = C_GREEN, text_size = size.tiny, text_halign = text.align_left)
Drawdown Monitor FAQ
Drawdown Monitor is free, runs on MT5 and TradingView and does not place trades.
Is Drawdown Monitor free?
Yes. Drawdown Monitor is free to download from this page with no sign-up, and the download includes the full source code.
Which platforms does Drawdown Monitor run on?
Drawdown Monitor is available for MetaTrader 5 (MQL5) and TradingView (Pine Script v6).
Does Drawdown Monitor give buy and sell signals?
The free version of Drawdown Monitor has no separate buy/sell signal system with SL and TP; it marks the chart as described under Features, and you decide how to trade it.
Does Drawdown Monitor have alerts?
Yes. Drawdown Monitor has built-in alerts: MT5 – pop-up, push notification, sound; TradingView – alert conditions for Create Alert.
Can an EA read Drawdown Monitor?
No. Drawdown Monitor draws chart objects (lines, boxes, labels or a panel) and has no indicator buffers for EAs.
Which timeframes does Drawdown Monitor work on?
Drawdown Monitor sets no timeframe limit in its code: it runs on any chart timeframe and on the symbol of the chart it is attached to.
Does Drawdown Monitor place trades?
No. It is a read-only indicator: it only reads market data and shows the result on the chart or writes it to a file. The source contains no calls that open, close or modify orders.
How do I install Drawdown Monitor?
Download the .zip and follow the step-by-step installation guide for MT5 and TradingView: https://indicators.dinexspace.com/install-guide/
Measured win rates (backtest)
Filter / stop-trading tool: no arrows yet; new arrow rules approved, in progress.
- Costs: Real spread of an ECN-type MT5 account, no commission.
- Data source: MT5 tick data (BNB: Binance spot).
TradingView H4/D1 bars may follow the exchange time zone of the TradingView symbol, not the MT5 server time (UTC) used for the measurement; sessions and the H4 trend may differ on the Pine version. Same signals on TradingView not checked yet.
Past test statistics are not a promise of future results.