Per Magic Equity Curve Tracker
One account balance figure is the sum of every strategy running on it. If three EAs share an account, a rising balance can mean two winners covering one loser, and the losing one keeps losing quietly until the day the winners stop carrying it. By the time the blended equity curve turns down, the actual cause has usually been visible for weeks in the one number nobody was watching separately. This tracker reads the open order pool and the closed-trade history and splits both realised and floating profit by magic number, then keeps a short rolling sample history per magic number and draws it as a compact sparkline directly on the chart - one row per strategy, colour coded, so divergence between strategies is visible at a glance rather than requiring a spreadsheet pivot after the fact. Realised profit only accumulates for trades that close after this EA is attached to a chart. Reconstructing every magic number's full historical profit on every attach was deliberately left out - the same reasoning DrawdownBreaker and EquityTrailingStop use elsewhere in this catalogue: it is unnecessary complexity for a number that only needs to move forward from the moment you start watching it. Notes and limitations - Realised profit is tracked only from the moment this EA is attached forward; it is not a historical backfill of each strategy's lifetime profit. Restarting the terminal without a saved baseline restarts the realised counter at zero, on both platforms. - Each sparkline is scaled to its own strategy's min/max sample, not a shared account-wide scale - it shows shape and direction per strategy, not a directly comparable magnitude between rows. The numeric total printed on each row is the figure to compare. - Reads the account-wide order/position pool and closed history every sample; fine at a one-minute-or-slower interval, not intended to run every tick. - A position built from more than one entry fill on MQL5 has multiple DEAL_ENTRY_IN deals sharing one position id; this tracker does not need an open-time figure, so that ambiguity never surfaces here, unlike a tool that reports holding duration.
Expert advisor · MT5 · v1.0 · Free
About Per Magic Equity Curve Tracker
Per Magic Equity Curve Tracker 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 Sample seconds, Max magic slots and Max samples. MQL source code included.
Files in the download: PerMagicEquityCurveTracker.ex5, PerMagicEquityCurveTracker.mq5, PerMagicEquityCurveTracker.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Sample seconds | 60 | Seconds between equity-curve samples |
| Max magic slots | 8 | Maximum distinct magic numbers tracked at once |
| Max samples | 80 | Sparkline points kept per magic number |
| Csv file name | PerMagicEquityCurveTracker.csv | Sample log, in MQL5\Files |
| Panel x | 20 | Panel X offset, pixels from the chart corner |
| Panel y | 20 | Panel Y offset, pixels from the chart corner |
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: Alerts · MT5 Expert Advisor · MQL5 Source Code