Loading…

Trailing Max Drawdown Tracker

Most home-made drawdown trackers draw a single static line below the starting balance and call it done. That is not what a trailing maximum drawdown rule actually says: the floor follows the equity high water mark upward by a fixed distance as the account grows, so a trader who has had a good run is closer to the real floor than a static-line tracker would ever show them. The tracker also implements the detail that trips up most home-made versions: many funded programmes stop the floor trailing once the high water mark reaches the account's starting balance, freezing it in place from that point on rather than letting it keep climbing forever. Getting this wrong in either direction - trailing past the freeze point, or never trailing at all - produces a figure that disagrees with the firm's own dashboard exactly when it matters most. The panel shows the current high water mark, the floor, whether the floor is still trailing or has locked, and the headroom remaining in both money and percent of the drawdown limit. A one-time alert fires when headroom falls to a configurable warning percentage, and again if the floor is actually touched. Notes and limitations This is a read-only monitor: it closes no positions and sends no orders, because whether a breach should force a flatten depends on programme terms this EA has no way to read. The starting balance and high water mark are both fixed at the moment the EA is attached and are not preserved across a terminal restart; reattaching begins a fresh run. Always confirm the exact wording of your own programme's drawdown rule - some measure from the initial balance rather than a trailing high water mark, and this EA is built for the trailing variant specifically.

Expert advisor · MT4 · v1.0 · Free

About Trailing Max Drawdown Tracker

Trailing Max Drawdown Tracker is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Initial balance override, Trailing drawdown percent and Lock at initial balance. MQL source code included.

Files in the download: TrailingMaxDrawdownTracker.ex4, TrailingMaxDrawdownTracker.mq4, TrailingMaxDrawdownTracker.txt.

Settings

SettingDefaultWhat it does
Initial balance override0.0Funded account's starting balance; 0 = use the balance at first tick
Trailing drawdown percent10.0Trailing max drawdown distance, percent of the initial balance
Lock at initial balancetrueStop the floor trailing further once the high water mark reaches the initial balance (typical prop r
Warn headroom percent20.0Alert once when remaining headroom to the floor falls to this percent of the DD limit

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Trailing Stop & Break-even · Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria