Skip to content

Trading metrics

Maximum Drawdown: How to Calculate It and What It Hides

Maximum drawdown is the largest fall in account equity from a running peak to a later trough, whether or not that peak has yet been regained. Calculate it as (peak − trough) ÷ peak and keep the worst value across the whole record: a fall from 12,000 to 9,000 is a 25% maximum drawdown. The figure records the deepest loss that happened, not the deepest loss that can happen, and it says nothing about how long recovery took.

Maximum drawdown is one of the risk measures in the trading performance metrics library. TradingView and MetaTrader 5 report several versions, so this page uses equity and a percentage of the running peak unless a section says otherwise.

Illustrative cover for maximum drawdown: an equity line falls from a peak to a trough and recovers, with the official PineConnector logo.
Maximum drawdown is measured from the running peak, not from where the account started.

Maximum drawdown at a glance

  • Definition: the largest peak-to-trough fall in equity over a stated period, measured from the running peak.
  • Formula (%): max over time of (running peak equity − equity) ÷ running peak equity × 100.
  • Other forms: in account currency; as a percentage of initial capital (TradingView); separately for balance and equity (MetaTrader 5).
  • Recovery maths: a drawdown d needs a gain of d ÷ (1 − d) to regain the peak. For 0 ≤ d < 1, a 50% drawdown needs +100%.
  • Duration: time under water, from the peak until equity first returns to it. Reported as a separate number.
  • Where to find it: TradingView strategy report; MetaTrader 5 Strategy Tester report and account Trading Report; PineConnector Analytics.
  • What it misses: how often drawdowns happen, how long they last, and anything deeper than the sample happened to contain.

How do you calculate maximum drawdown?

Maximum drawdown % = max over time of (running peak equity − equity) ÷ running peak equity × 100

  • Equity: account value including the floating profit or loss of open positions. MetaTrader 5 defines balance as excluding the results of open positions and equity as including them.[1]
  • Running peak: the highest equity reached up to that moment. Every drawdown is measured from it.
  • Trough: the lowest equity after that peak, including an unrecovered fall at the end of the record.
  • Maximum: the largest of those peak-to-trough falls across the whole record.

MetaTrader 5 writes the percentage form as the largest (local high − next local low) ÷ local high × 100.[3]

The percentage formula requires a positive running peak. At zero or negative equity, also report the currency loss; ordinary recovery percentages no longer describe recapitalisation.

Balance or equity, relative or absolute?

Balance excludes floating profit and loss, but also changes with deposits, withdrawals and other balance adjustments. Equity drawdown also counts floating losses on open positions, so it can be deeper for the same account. MetaTrader 5 also reports an absolute drawdown: the initial deposit minus the lowest balance below it, measured from the start rather than from a peak.[3] An account that rises and then falls back can show a large relative drawdown and zero absolute drawdown.

Worked example: peak, trough and recovery

Illustrative numbers, not a recommendation or a strategy result. An account starts at 10,000 and is measured at the end of each of nine periods. Assume no deposits, withdrawals, credits or other balance adjustments.

Scroll horizontally to read every column.

Period Equity Running peak → drawdown
0 10,000 10,000 → 0%
1 9,500 10,000 → 5.0%
2 11,000 11,000 → 0%
3 12,000 12,000 → 0%
4 10,800 12,000 → 10.0%
5 9,000 12,000 → 25.0%
6 10,200 12,000 → 15.0%
7 11,400 12,000 → 5.0%
8 12,000 12,000 → 0%
9 12,600 12,600 → 0%
Illustrative equity path rising from 10,000 to a 12,000 peak, falling to a 9,000 trough and regaining the peak, marking a 25% maximum drawdown and five periods under water.
Illustrative numbers from the worked example, not a strategy result. Depth is measured from the running peak; duration is a separate number.
  1. Maximum drawdown: the deepest point is period 5. (12,000 − 9,000) ÷ 12,000 = 3,000 ÷ 12,000 = 25%.
  2. The same fall on other bases: as a percentage of initial capital, 3,000 ÷ 10,000 = 30%. MetaTrader 5's absolute drawdown on this equity series is 10,000 − 9,000 = 1,000.
  3. Balance versus equity: suppose no position is open at the other periods, but at period 5 an open position carries a 600 floating loss. Balance is 9,600 while equity is 9,000. Balance drawdown is (12,000 − 9,600) ÷ 12,000 = 20%. Equity drawdown is 25%. Across the whole record, the lowest balance is the earlier 9,500 at period 1. Balance absolute drawdown is therefore 10,000 − 9,500 = 500; equity absolute drawdown is 1,000.
  4. Gain needed to recover: 0.25 ÷ (1 − 0.25) = 0.25 ÷ 0.75 = 33.3%. Check: 9,000 × 4 ÷ 3 = 12,000.
  5. Time under water: equity leaves the period 3 peak and first returns to 12,000 at period 8. The drawdown lasts five periods: two falling and three recovering.
  6. Maximum versus typical: the record has two drawdown phases, 5% over two periods and 25% over five. The maximum reports only the second.

Calculator

Drawdown recovery calculator

Gain needed to recover = d / (1 - d)

d is the peak-to-trough drawdown as a fraction of the peak. The recovery gain is measured from the trough. A 50% drawdown (d = 0.5) needs a gain of 100% to return to the peak.

Peak to trough, 0 to 100
Account currency

Worked example with the default inputs.

Gain needed to return to the peak
25.00%
Equity at the trough
8,000.00
Amount to regain
2,000.00

Working 0.2 / (1 - 0.2) = 25.00%

Illustrative calculator. Not a recommendation.

How much gain does it take to recover from a drawdown?

Gain needed to recover = d ÷ (1 − d), where 0 ≤ d < 1 is the drawdown as a decimal

After a fall of d, equity stands at (1 − d) of its peak. Regaining the peak needs a gain g where (1 − d) × (1 + g) = 1, so g = 1 ÷ (1 − d) − 1 = d ÷ (1 − d). Shallow drawdowns need a gain slightly larger than the loss; deep ones need several times the loss. At a 100% loss, equity is zero: no finite percentage gain on that zero balance restores the peak.

Drawdown from the peak Gain needed to regain the peak
5% 5.3%
10% 11.1%
20% 25.0%
25% 33.3%
30% 42.9%
40% 66.7%
50% 100%
60% 150%
75% 300%
90% 900%

The formula gives the size of the gain, never the time it takes. TradingView reports duration separately, as the average number of calendar days from a peak until equity regains it.[4] Runs of consecutive losses are one way a drawdown forms; the losing streak probability guide covers how long those runs can be.

Where does maximum drawdown show up in TradingView and MT5?

The platform definitions below are as of 25 September 2026. The same label can cover different calculations.

TradingView strategy report

  • Max drawdown (intrabar): calculated for every bar with an open position, from the highest closed-trade equity (or initial capital) before that trade opened, using the bar's low for a long and its high for a short. On the closing bar, TradingView instead follows its assumed intrabar path up to the exit; for an exit at the open, that opening price is both the minimum and maximum used.[5]
  • Max drawdown (close-to-close): "the largest drop in account equity from a previous closing high to a subsequent closing low".[6]
  • Max drawdown as % of initial capital (intrabar): the percentage base is starting capital, not the running peak.[7] In the worked example, the two bases give 30% and 25% for the same fall.

The TradingView strategy report metrics guide explains the neighbouring fields. For a custom running-peak series, record equity at each observation, retain the highest value so far, and apply the percentage formula above. A period-end series can miss intrabar losses.

Strategies execute at bar close by default, but historical execution is configurable.[8] Since July 2026, Script execution includes historical-tick execution through calc_on_every_history_tick on standard charts for Premium and Ultimate users; Bar detalization controls the intrabar detail available. Record these settings when comparing a sampled equity series with report drawdown.[18]

MetaTrader 5 Strategy Tester report

The tester reports six drawdown fields.[3]

Report field What it measures
Balance Drawdown Absolute Initial deposit minus the lowest balance below it.
Balance Drawdown Maximal Largest fall in deposit currency from a local balance high to the next low, with its percentage in brackets.
Balance Drawdown Relative Largest percentage fall from a local balance high, with its currency amount in brackets.
Equity Drawdown Absolute, Maximal and Relative The same three calculations on equity, which includes open positions.

Maximal and Relative can come from different episodes. MetaQuotes' own example balance history has a largest percentage fall of 33.3% (6,000 to 4,000, or 2,000) and a largest currency fall of 2,500 (8,000 to 5,500, or 31.25%).[1]

After a withdrawal, the tester restarts its drawdown calculation and keeps the largest value.[3] The recovery factor guide covers the ratio MetaTrader 5 builds from maximum drawdown, and the MT5 Strategy Tester report guide covers the rest of the report.

MetaTrader 5 account report and optimization results

For a live or demo account, the Trading Report's Max. Drawdown is the largest percentage drop from a local maximum, showing the balance or equity figure, whichever is worse.[9] In optimization results, the Drawdown column is relative equity drawdown, coloured from green (0–5%) to red (greater than 30%).[10] MetaQuotes presents that colouring as an aid to visual analysis, not as a benchmark.

PineConnector Analytics

PineConnector Analytics shows a Drawdown figure: how far the account has fallen from a previous high under the dashboard's stated calculation. The docs say to check whether it is current or maximum drawdown, and to check Last Updated. Analytics needs MT5 EA v3.41 or later and is not available for MT4 in the published guide.[11]

How does a drawdown rule travel from TradingView to an MT5 order?

"Stop if the drawdown gets too deep" is an intention, not yet a rule. A measurable version names the equity series, the base, the threshold, when it is checked, the action and who resets it. The rule specification guide shows how to write each field, and when to pause automated trading covers the pause decision.

Illustrative diagram of four layers a drawdown rule passes through: Pine simulation, TradingView alert and webhook, PineConnector EA account protection and the MT5 account. The alert only carries a message; the other three see different equity figures.
Illustrative signal path. Each measuring layer sees its own figure, and only the MT5 account shows the equity that actually changed.
  • Pine strategy rule: strategy.risk.max_drawdown() defines a drawdown limit. Once it is reached, the simulated strategy cancels pending orders, closes open positions and places no new orders.[2] The rule measures simulated equity, not the broker account. These risk commands run on every tick and order execution event regardless of the script's calculation settings.
  • TradingView alert: the rule firing, the alert triggering and webhook delivery are separate events. Do not assume that adding a Pine risk rule sends a valid PineConnector close command. Verify the alert message, delivery and resulting broker positions on demo before relying on the workflow.
  • PineConnector EA account protection: Daily Loss uses a threshold against the day's starting balance; Cumulative Loss tracks loss from a baseline set when tracking began or was reset. Each pairs a threshold with an action such as Halt EA.[12] A limit from a running equity peak is not documented; test on demo.
  • Halt request: the documented closealleaoff command requests closure and cancellation within the EA's scope, then halts the EA.[13]
  • The MT5 account: actual equity includes every position, at broker prices and fills. TradingView and MetaTrader can use different feeds, quotes and spreads.[14] The Pine Script converter does not resynchronise simulated and broker positions.[15]

Illustrative message, not a recommendation. Paste destination: TradingView alert, Message field. Replace LicenseID with the License ID from Portal Connections and ChartSymbol with the receiving EA's chart symbol.

LicenseID,closealleaoff,ChartSymbol

Check each stage on demo: the condition becoming true, the alert triggering, webhook delivery, PineConnector processing, the EA's close requests, and the broker's deals and positions. The docs also say to allow for slippage between a threshold and the final result.[12] Confirm the final state in MetaTrader 5, not from the alert log.

What does maximum drawdown hide?

One path's worst case, not the worst case

A backtest shows one ordering of trades. Illustrative: start at 10,000 with two wins of 1,000 and two losses of 500. Alternating them (+1,000, −500, +1,000, −500) gives a maximum drawdown of 500, or 4.5%. Taking both losses first gives 1,000, or 10%. Both paths end at 11,000.

Longer records find deeper drawdowns

Adding time can only keep a record's maximum drawdown the same or make it deeper, because the longer record contains the shorter one. A backtest's maximum drawdown is a floor for the combined record, not a ceiling for the next period. The backtest sample size guide explains why short records mislead.

Hindsight, overfitting and costs

Choosing parameters because their backtest drawdown looked shallow can overfit that record. TradingView warns that overfitted strategies can fail on unseen data, and its commission example shows a deeper maximum drawdown once costs are simulated.[2] Keep a separate period for evaluation and compare results using realistic costs.

Common mistakes when comparing drawdowns

  • Mixing percentage bases: TradingView's percentage of initial capital and MetaTrader 5's percentage of the local high give different numbers for the same fall.
  • Mixing sampling: close-to-close figures miss intrabar lows, and period-end snapshots, like the worked example's, miss lows between them.
  • Ignoring cash flows: deposits and withdrawals move balance without trading. MetaQuotes' Build 5800 (16 April 2026) fixed a trading-report issue in which withdrawals could be incorrectly included in balance drawdown.[16]
  • Measuring one strategy on a shared account: its drawdown ignores other strategies and manual trades.
  • Reading depth alone: two records with the same maximum can differ in how often they fall and how long they stay under water. TradingView's average drawdown (close-to-close) is the mean decline across all drawdown phases, from a local maximum to a new low.[17] For the chance of reaching a given loss level, see risk of ruin.

Frequently asked questions

What is max drawdown in trading?

Max drawdown in trading is the largest fall in account or strategy equity from a running peak to a later trough, whether or not that peak has yet been regained. Traders usually quote it as a percentage of the peak: a fall from 12,000 to 9,000 is 25%. Platforms also report it in currency.

How do you calculate drawdown?

To calculate drawdown, track the highest equity reached so far and divide the gap between that running peak and current equity by the positive peak. Maximum drawdown is the largest of those values over the record. A peak of 12,000 and a trough of 9,000 give (12,000 − 9,000) ÷ 12,000 = 25%.

How much gain does drawdown recovery need?

Drawdown recovery needs a gain of d ÷ (1 − d), where 0 ≤ d < 1 is the drawdown as a decimal. A 10% drawdown needs about 11.1% to regain the peak, 25% needs 33.3% and 50% needs 100%. At a 100% loss, no finite percentage gain on zero equity restores the peak. The formula gives the size of the gain, not how long recovery takes.

What is the difference between balance drawdown and equity drawdown?

Balance excludes floating profit or loss on open positions, while equity includes it. Equity drawdown can therefore be deeper for the same account. Deposits and withdrawals can affect both series. A floating loss that recovers before closing may therefore leave no corresponding balance drawdown. The MetaTrader 5 Strategy Tester reports both.

Is there a good maximum drawdown?

There is no universal good maximum drawdown. The figure depends on position size, the length of the record, the percentage base and what the account holder can tolerate. MetaTrader 5 colours optimization results from green at 0–5% drawdown to red above 30%, but that colouring is a visual aid, not a benchmark.

Reviewed 25 September 2026. Facts were checked against the linked sources on that date. Nothing in this article was tested on a trading account and no code was compiled.

Sources

  1. MetaQuotes – MetaTrader 5 Help: Trading Report for advanced users, drawdown calculation example, accessed 25 September 2026.
  2. TradingView – Strategies: risk management and testing limitations, accessed 25 September 2026.
  3. MetaQuotes – MetaTrader 5 Help: Testing Report, accessed 25 September 2026.
  4. TradingView – Average drawdown duration (close-to-close), accessed 25 September 2026.
  5. TradingView – Max drawdown (intrabar), accessed 25 September 2026.
  6. TradingView – Max drawdown (close-to-close), accessed 25 September 2026.
  7. TradingView – Max drawdown as % of initial capital (intrabar), accessed 25 September 2026.
  8. TradingView – Pine Script execution model, accessed 25 September 2026.
  9. MetaQuotes – MetaTrader 5 Help: Trading Report, accessed 25 September 2026.
  10. MetaQuotes – MetaTrader 5 Help: Strategy Optimization, accessed 25 September 2026.
  11. PineConnector – Trading analytics: read the performance metrics, accessed 25 September 2026.
  12. PineConnector – EA settings: account protection, accessed 25 September 2026.
  13. PineConnector – Syntax reference: EA controls, accessed 25 September 2026.
  14. PineConnector – Frequently asked questions: price differences, accessed 25 September 2026.
  15. PineConnector – Pine Script converter: supported behaviour, accessed 25 September 2026.
  16. MetaQuotes – MetaTrader 5 release notes: Build 5800, accessed 25 September 2026.
  17. TradingView – Average drawdown (close-to-close), accessed 25 September 2026.
  18. TradingView – Pine Script release notes: July 2026 strategy changes, accessed 25 September 2026.

PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.

1 comment

Back to PiCo Blog

Run your strategies on our managed infrastructure

Bridge routes TradingView alerts to MetaTrader. Edge hosts and runs MT5 for you.

Core Trial

Then $59/month unless you cancel.

$7for 7 days

  • 3 account connections
  • 1 hosted MT5
  • Unlimited alerts, routed by Bridge
Try Core for $7

Trusted by 66,000+ traders in 156 countries and territories · <1s typical latency

Your Edge MT5 runs in our cloud · nothing to install · built on Microsoft Azure