Backtesting

How to Backtest Trade't EAs with MQL5 Economic News

Export MetaTrader 5 Economic Calendar data once, then use the snapshot to run reliable news-aware backtests with supported Trade't EAs.

2026-07-21

Why a Calendar Snapshot Is Required

Trade't EAs use MetaTrader 5's native Economic Calendar for live news filters and news-driven strategies. This removes the need to allow WebRequest access to an external calendar website.

MetaTrader's Economic Calendar is not available directly inside the Strategy Tester. To backtest an EA that uses news, you must first export the calendar from a normal connected chart. The exporter writes a snapshot named CalendarV2.bin, which supported Trade't EAs can read during testing.

For more technical detail, see the official MQL5 Economic Calendar reference and MetaQuotes' calendar testing guidance.


What You Need

  • The latest version of a supported Trade't EA
  • MetaTrader 5 connected to your broker
  • MQL5NewsV2ExporterEA.ex5
  • The same broker server for exporting and backtesting
  • Local Strategy Tester agents

Download MQL5NewsV2ExporterEA.ex5

The exporter only collects calendar data. It does not open or manage trades.


Step 1: Choose the Export Range

Choose your intended backtest dates before running the exporter. Make the export range wider than the test itself so the EA can inspect news immediately before the test starts and after it ends.

For example, if your backtest runs from 2024.01.01 through 2025.12.31, choose an earlier export start and a later export end. The required buffer depends on the EA and its news settings, so allow extra days on both sides rather than exporting only the exact test dates.

Calendar dates use your broker's trade-server time, not your computer's local time. Export from the same broker server that you will use in the Strategy Tester.


Step 2: Install the Exporter

  1. Download MQL5NewsV2ExporterEA.ex5 using the link above.
  2. In MetaTrader 5, select File -> Open Data Folder.
  3. Open the MQL5\Experts folder.
  4. Copy MQL5NewsV2ExporterEA.ex5 into that folder.
  5. Return to MetaTrader, open the Navigator, and select Refresh under Expert Advisors.

Step 3: Run It on a Connected Chart

Attach MQL5NewsV2ExporterEA to any normal chart while MetaTrader is connected to your broker.

Do not run the exporter inside the Strategy Tester. It needs access to the live terminal's MQL5 Economic Calendar so it can create the historical snapshot used by the tester.


Step 4: Configure the Three Inputs

The exporter has only the following user inputs:

InputWhat to enter
InpFromThe beginning of the calendar export, entered in broker server time. Set it before your intended backtest start.
0 = one year after current server timeThe export end. Enter an explicit date after the intended backtest end, or leave it at 1970.01.01 00:00:00 to use approximately one year after the current server time.
InpCurrenciesA comma-separated list of the currencies needed by your EA, such as USD,EUR,GBP,JPY,CHF,CAD,AUD,NZD.

In MQL5, the date 1970.01.01 00:00:00 represents the numeric datetime value 0. The exporter interprets that zero value as the automatic one-year end option. See the official MQL5 datetime reference for how date values are represented.

Export only the currencies required by the strategy. For example:

  • For a USD-only news filter, use USD.
  • For EURUSD events affecting both currencies, use EUR,USD.

Step 5: Wait for the Export to Finish

Keep the chart and MetaTrader open while the exporter collects the calendar data. Check the chart and the Experts log for its completion status.

When the export finishes successfully, the snapshot is written to MetaTrader's shared Common Files area:

<MetaTrader Common Data Path>\Files\MQL5NewsV2\CalendarV2.bin

The file is deliberately stored in Common Files so a local Strategy Tester agent can read the same snapshot. MetaQuotes documents this shared-folder behavior in Testing Trading Strategies.


Step 6: Run the Backtest

  1. Open the MetaTrader 5 Strategy Tester.
  2. Select the latest version of your Trade't EA.
  3. Choose a broker server and test period covered by the exported snapshot.
  4. Use local testing agents, not remote agents or the MQL5 Cloud Network.
  5. Start the test. The EA reads MQL5NewsV2\CalendarV2.bin automatically when its news features are used.

If the EA supports drawing calendar lines or event markers, enable Visual Mode to see them. A normal non-visual test can still apply the news rules without displaying chart objects.


Troubleshooting

CalendarV2.bin was not created

  • Confirm the exporter is attached to a normal connected chart.
  • Keep the chart open until the export completes.
  • Check the Experts log for calendar or connection errors.
  • Run the exporter again after confirming MetaTrader can display its Economic Calendar.

The test date is outside calendar coverage

The snapshot begins after your test starts or ends before your test finishes. Export a wider date range, including a buffer before and after the tester dates.

The snapshot server differs from the tester server

Reconnect MetaTrader to the same broker server used by the Strategy Tester and create a new snapshot. If you test with several brokers, generate a matching snapshot for each server.

The file exists but the EA cannot read it

  • Confirm the file is named exactly CalendarV2.bin.
  • Confirm it is inside the MQL5NewsV2 folder under MetaTrader's Common Files directory.
  • Confirm you are using local testing agents.
  • Restart the Strategy Tester after generating a new snapshot.

News rules work but no objects are visible

Enable Visual Mode and confirm the test date and selected currencies are covered by the snapshot. The EA may draw only events matching its configured currencies, impact levels, or keywords.


Backtesting Limitations

A historical calendar snapshot makes news decisions reproducible, but it cannot recreate every live-market condition. MetaTrader's Strategy Tester may not reproduce the widened spreads, slippage, liquidity changes, and exact execution behavior that can occur around an economic release.

Treat news-aware backtests as research and configuration tools, not as guarantees of future performance. Always validate settings on a demo account before considering live use.