Backtest stops early

Modified on Sun, 25 Oct, 2020 at 12:24 AM

Symptoms


When running a backtest it stops earlier than it should, even though you downloaded tick data past the date the backtest stops at.


Cause


This can happen due to a variety of reasons and the most common of them will be discussed below:

  1. MQL Market EA limitation - EA demo versions downloaded from the MQL market are typically limited when it comes to the most recent date you can backtest. If you are backtesting an MQL Market EA, this is almost certainly the cause. You can easily check by running a backtest of the MACD Sample EA with the same options and same data - if it trades until the end, the problem is this limitation. Be sure to set a sufficiently high starting balance and a minimal lot for the MACD Sample EA.
  2. Stop out - many EAs fail to withstand adverse market conditions and get stopped out before the backtest ends. You can check if this is the case by inspecting the backtest journal: when the log stops scrolling, one of the 2-3 lines at the top will say "<EA name> stopped because of Stop Out".
  3. Lack of tick data synchronization - if you download tick data in the Tick Data Manager while MT4 is running, your MT4 terminal will not "notice" this on its own. You can check if this is the case by opening the Tick data settings dialog in MT4 and comparing the start and end dates to those displayed in the Tick Data Manager.
  4. Incorrect tick data source selected - by default, the Dukascopy source is selected in MT4. If you downloaded tick data from a different source (e.g. TrueFx) but did not update the selected source in MT4, it will by default use Dukascopy and ignore the tick data you downloaded from a different source.
  5. Use date checkbox enabled - if you enabled the Use date checkbox in the MT4 backtest pane and configured a start and end date for the backtest, it will naturally stop when it reaches the end date.


Resolution


For each of the points above:

  1. MQL Market EA limitation - the only way you can backtest that particular EA on the whole date range is to purchase it.
  2. Stop out - change the settings to avoid a stop out or contact the EA developer for more information.
  3. Lack of tick data synchronization - open the Tick data settings dialog in MT4 and click the Refresh button in the Basic tab. This will make it re-read the tick database and update the start and end dates.
  4. Incorrect tick data source selected - open the Tick data settings dialog in MT4 and select the desired tick data source in the Source dropdown.
  5. Use date enabled - disable Use date in the MT4 backtest pane.


If the cause is not one of those described above, it's a good idea to inspect the backtest journal tab for more information. If there's no relevant information there, you can also try to run a visual backtest of the EA in the hope that it displays some relevant information on the chart.


If that also fails, the next step is determined by running a MACD Sample EA backtest as described above: ensure Use date is disabled, use the same tick data settings as for your EA, provide a sufficiently high starting balance and configure it to use the minimum lot size accepted by your account. At this point, there are two potential avenues:

  1. If the MACD Sample EA backtest goes through the whole backtest, it means the problem is related to the EA you are backtesting. You can either contact the EA developer for more information or if it's an EA of your own making, debug it.
  2. If the MACD Sample EA stops at the same date and the Basic tab of the Tick Data Settings dialog shows that there should be more tick data, please open a support ticket at https://eareview.net/support, describe the problem, attach a screenshot of the Basic tab and copy/paste the last 4 lines that get printed to your backtest journal when the backtest ends. If you already opened a ticket about this, attach the screenshot and paste the lines in a reply to that ticket.