Drawdown Recovery Mathematics
A loss and the gain needed to undo it are not the same percentage, and the gap grows faster than most traders expect. A 20% loss needs a 25% gain to recover; a 50% loss needs 100%; a 90% loss needs 900%. The relationship is convex - it gets worse than intuition expects once losses pass roughly 30-40% - because the recovery gain is computed against the smaller post-loss balance, not the original one. This script prints the trader's own numbers first: type in the account's real historical peak balance (MT4 keeps no running record of it, so this has to be supplied), optionally let the current figure come live from account equity, and the script computes the exact current drawdown and the exact gain required to recover it. Underneath that it prints a full reference grid across a range of loss percentages so the shape of the curve is visible, with the row closest to the trader's own drawdown marked. Notes and limitations - Recovery here means "gain enough, with nothing else happening, to reach the typed peak again". It ignores time, trading costs, and any further losses incurred on the way back up. - If InpYourPeakBalance is set too low (below the true historical peak), the reported drawdown and required gain will understate reality - the figure is only as honest as what gets typed in. - This is arithmetic, not a trading signal. It says nothing about whether or how a drawdown will actually be recovered, only what recovering it mathematically requires.
Script · MT5 · v1.0 · Free
About Drawdown Recovery Mathematics
Drawdown Recovery Mathematics is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Your peak balance, Use live equity as current and Your current balance. MQL source code included.
Files in the download: DrawdownRecoveryMaths.ex5, DrawdownRecoveryMaths.mq5, DrawdownRecoveryMaths.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Your peak balance | 10000.0 | Type your account's real historical peak balance/equity here |
| Use live equity as current | true | If true, use this account's live equity as "current"; else use InpYourCurrentBalance |
| Your current balance | 8000.0 | Manual mode only: your account's current balance/equity |
| Grid start loss pct | 5.0 | Reference grid's first loss percentage row |
| Grid max loss pct | 90.0 | Reference grid's last loss percentage row |
| Grid step loss pct | 5.0 | Increment between grid rows |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Grid · Alerts · MT5 Script · MQL5 Source Code