TradeMath Trade History Statistics
- Utilities
-
Ganzorig Munkhbayar
Test - Version: 1.0
TradeMath is a read-only script. It reads the closed trades of the account it runs on and prints five numbers that describe the trading so far. It opens, changes and closes nothing. It measures the past and predicts nothing.
The five numbers
- Expectancy: win % x average win - loss % x average loss = the average trade after costs. Also the net result and the profit factor.
- Costs: swap, commission and fees in money and as a share of the gross profit.
- Drawdown: the deepest fall of the closed-trade balance, how far the balance is below its peak now, and the gain needed to recover.
- Losing streak: the longest run of losing trades, and what a streak of that length costs at 1 %, 2 % and 5 % risk per trade.
- Luck test: the t statistic of the average trade. It says whether the result can be told apart from luck, and about how many trades of this kind it would take to know.
How to use it
Drag TradeMath from the Navigator onto any chart. The symbol and timeframe of the chart do not matter. The report appears on the chart and in the Experts tab. With Save_Report on, it is also written to a text file in the MQL5\Files folder of the terminal.
Inputs
- From_Date, To_Date: the period. To_Date 0 means now.
- Magic_Filter: -1 = every trade; otherwise only the trades with one magic number (0 = manual trades).
- Symbol_Filter: empty = every symbol; otherwise one symbol.
- Save_Report: also write the report to a text file.
How to read the report
If the average trade is negative, the method loses, and a different lot size only changes how fast. If costs take a large share of the gross profit, the method trades too often or its stops are too short for its costs. If the losing streak at your real risk is more than you could bear, lower the risk per trade. If the luck test says the result cannot be told apart from luck, there are still too few trades to rely on it.
Limits
- Spread is paid inside the prices, so it is not in the cost line.
- Deposits and withdrawals in the period are not separated from the balance curve.
- The drawdown percentages start from the current balance minus the net result of the selected trades. With Magic_Filter or Symbol_Filter they are approximate.
- With fewer than 30 trades the luck test only says that there are too few trades.
- A position that is partly closed and still open is counted only after it is fully closed.
- The report and its file name contain the account number. Remove it before you share the report.
The numbers measure the past only. A positive past is not a promise for the future. Check the numbers against your broker's statement before you rely on them.
