Expert Advisor Statistics by Magic Number MT4
- Indicateurs
-
Pitt Petruschke
Algo trader and EA developer from Germany. Founder of AlgoVerdict (algoverdict.com) – independent tests of Expert Advisors, brokers and signal platforms based on live accounts. - Version: 1.0
You run several EAs on one account, plus a few trades by hand. The balance shows the total. It doesn't show which EA earns the money and which one gives it back.
Magic Stats reads the account history of your MT4 account and shows one row per magic number: how each EA has actually performed, in any period you choose. It is an indicator, so it sits on a chart next to any EA. It never opens, changes or closes a trade.
What you see for every EA (magic number)
- Name and symbols traded
- Trades, win %, net profit (profit + swap + commission), in the account currency
- Profit factor, average trade
- Max drawdown of the EA's closed-trade equity curve (in money) and recovery factor (net / max drawdown)
- Last trade date, open orders now and their floating P/L
- A small equity line per row (up to 20 points), green or red
- A Total account row: all trades of the period as one combined curve
Profit in green, loss in red; PF of 1.5 or more green, below 1.0 red. Magic 0 is shown as Manual (terminal, mobile app, tools without a magic).
Periods and sorting
- Tabs: TODAY, WEEK (from Monday), MONTH, YEAR, ALL history, CUSTOM (from a date you set). All in broker server time.
- Click a column header to sort by Trades, Win %, Net, PF or Max DD. Click again to switch between descending and ascending.
- Optional: split every magic by symbol, one row per magic and symbol.
- Name map: 12345=TrendEA;777=IndexBot turns numbers into names. Without it, a row takes the most frequent order comment of the EA (broker markers such as [sl] or [tp] removed), otherwise "Magic 12345".
How trades are counted on MT4
- Each closed market order (buy or sell) in the account history is one trade. Its result is profit + swap + commission.
- The magic number is the order's magic number. MT4 keeps it when an order is closed by stop loss or take profit, so an EA's losing trades don't end up under "Manual".
- Partial closes: MT4 continues the rest of a partly closed order under a new ticket ("from #..."). Magic Stats joins these pieces into one trade, with the magic number and open time of the original order. It is counted when the last piece closes, in the period of that final close.
- Close by: both orders count as trades.
- Deleted or expired pending orders, deposits, withdrawals and credit never count as trades.
- Max drawdown is closed-trade drawdown: peak to trough of the equity curve built from closed trades, starting at 0 at the period start. Floating P/L is not in it; it has its own column. The panel says so in its coverage line.
CSV export
One click writes the current tab, in the current sort order, to MQL4\Files\MagicStats_<account>_<period>.csv: one line per row plus the total, with gross profit, gross loss, wins and losses as extra columns. Separator ;, decimal separator dot or comma (input, comma for European Excel), UTF-8.
Next to any EA, and private
- An indicator with no buffers: put it on any chart, any symbol, any timeframe, also next to an EA.
- Read-only. It never trades.
- Nothing is sent anywhere: no internet functions, no DLL. The only file it writes is the CSV, and only when you click EXPORT CSV.
- Large histories are read in slices of 2,000 orders, so the chart stays responsive. After that, only new orders are processed (default: every 10 seconds), and a later change in the history triggers a rebuild.
Important on MT4: show the whole history
An MT4 indicator only sees what the Account History tab of the terminal holds. Open the Terminal window (Ctrl+T) → Account History → right-click → All History. If the numbers look too small or the first trade is too recent, this setting is almost always the reason. The panel shows a reminder.
Free
Free and fully working: no time limit, no trial mode, no nag screens, no adverts inside the program.
Limitations
- Only closed trades count. Profit already realised by a partial close appears when the rest of the order is closed.
- Max drawdown does not include the drawdown while a trade was open. The intra-trade drawdown can be much larger.
- Floating P/L is profit + swap of the open orders; commission is added to the trade when it closes.
- Several Magic Stats instances can run on one chart, but they are drawn at the same place unless you give each one its own Panel X / Panel Y. In the Strategy Tester Magic Stats only sees the tester's own orders.
- This is the MetaTrader 4 version. A MetaTrader 5 version is available separately.
Past results shown by Magic Stats describe your own history only and do not predict future performance. Trading leveraged products carries a high risk of loss.
