Backtest vs Live
- ユーティリティ
-
Mohamed-amine Baddir
MetaTrader 5向けのExpert Advisor(EA)を開発し、実際に取引で使用する前に十分なテストを行います。
対応内容:
お客様のトレード戦略、TradingViewスクリプト、または文章化されたルールを、クリーンなMT5 Expert Advisorに変換
既存EAの修正・バグ修正:リスク%によるロットサイズ計算、トレーリングストップ、セッション・時間フィルター、スプレッドフィルター、複数銘柄ポートフォリオ、ドローダウン保護 - バージョン: 1.0
- アクティベーション: 5
Backtest vs Live explains why an Expert Advisor earns a different amount live than in the Strategy Tester. It matches every live trade with its twin in the backtest, then splits the whole difference of the results, to the cent, into entry prices, exit prices, swap and commission, lots and currency conversion, trades the backtest made that live trading missed, and live trades the backtest never made. It can also compare two backtests, for example the same Expert Advisor with and without execution delay, or two brokers.
How To Use
- Test the Expert Advisor in the Strategy Tester over the period it traded live, with the same symbol and settings. Right click on the Backtest tab > Report > save it as HTML into MQL5\Files\BacktestLive (File > Open Data Folder).
- Attach Backtest vs Live to any chart of the account that traded live, and set the magic number of the Expert Advisor in the inputs.
- Open MQL5\Files\BacktestLive\BacktestLive.html in any browser. The time tolerance of the matching can be changed at the top of the page.
- To compare two backtests instead, set "Compare the backtest with" to a second saved report.
What The Page Shows
- Net profit of both sources over their common period, the difference, and the number of matched trades.
- A waterfall from the first result to the second: entry prices, exit prices, swap and commission, lots and conversion, trades only in the first source, trades only in the second. The steps add up exactly, and the page checks it.
- Both equity curves of closed trades on one chart.
- The distribution of entry and exit slippage in points, and the average entry slippage by hour of the day.
- Results and slippage by symbol.
- The matched trades with the largest difference, with both entry and exit prices, and the lists of trades without a twin.
Matching
- A trade is matched with the nearest free trade of the other source with the same symbol and direction whose entry is within the tolerance (5 minutes by default).
- Symbol names of different brokers are matched automatically when one starts with the other (EURUSD and EURUSDm), or by the symbol map input.
- A time shift input corrects a different server time zone between the backtest and the live broker.
- Trades closed in parts and reversals are matched with their entries, oldest first, in reports; by position in the account history.
Inputs
- Compare the backtest with: the history of this account, or a second saved report
- Folder in MQL5\Files with the saved reports; the backtest report and the second report (empty = the first and second reports of the folder)
- Account history: magic number, symbol
- Match entries within (minutes)
- Hours added to the times of the second source
- Symbol names, backtest=second (e.g. XAUUSD=GOLD)
- Folder in the common Files folder of all terminals
- Page title
Good To Know
- Slippage is valued with the money per point of each backtest trade, so the entry and exit steps are in the account currency of the backtest.
- The demo runs in the Strategy Tester and compares two reports: put two saved reports into the common folder Files\BacktestLive (File > Open Common Data Folder); the page is written when the test ends.
- The screenshots compare two tests of an example Expert Advisor on EURUSD, one with a 2 second execution delay. They show the page, not trading results to expect.
- The utility reads files and history only. It does not trade and does not change any setting.
