Can't backtest EA on Futures - page 3

 
@Anton #"start time changed ... to provide data at beginning" - this line contains a date that you for some reason decided to hide. I think this date itself is already an answer to your question.

No, the user did not hide anything and was very clear about the steps taken. I replicated the same steps and got the same message reported by the Strategy Tester journal.

The user and I both set the test period to 2025.06.25 to 2025.06.30. Both I and the OP checked the available OHLC and tick data in the Symbols panel, yet the Tester incorrectly made the adjustment.

It is some kind of bug or misconfiguration on MetaTrader (or MetaTester). The OP did not mislead in anyway, and both I and @Alain Verleyen have confirmed the issue.

 
Anton #:

"start time changed ... to provide data at beginning" - this line contains a date that you for some reason decided to hide. I think this date itself is already an answer to your question.

Could you please take this bug report seriously ? Beside the OP, you have 2 moderators, investing their time freely for MetaQuotes, confirming it. A respectful answer is a minimum for a commercial company.

It's a bug or at least an undocumented limitation, and you make a fool of yourself publicly.

 

"start time changed ... to provide data at beginning"

I would like to see the full version of this line.
 
@Anton #I would like to see the full version of this line.

"Full version" was provided in the initial post by the OP, but here it is again highlighted for easier visualisation ...


 
Fernando Carreiro #:

"Full version" was provided in the first post, but here it is again highlighted for easier visualisation ...


The test period is from 2025.06.25 to 2025.06.30, and the test start time is shifted to 2025.08.19.

The testing agent downloads only the missing history, with a small margin to provide the necessary data on the history, for the calculation of the indicators at the starting time of testing. For the time-frames D1 and less, the minimum volume of the downloaded history is one year.

Thus, if we run a testing on an interval 2010.11.01-2010.12.01 (testing for an interval of one month) with a period of M15 (each bar is equal to 15 minutes), then the terminal will be requested the history for the instrument for the entire year of 2010. For the weekly time-frame, we will request a history of 100 bars, which is about two years (a year has 52 weeks). For testing on a monthly time-frame the agent will request the history of 8 years (12 months x 8 years = 96 months).

If there isn't necessary bars, the starting date of testing will be automatically shifted from past to present to provide the necessary reserve of bars before the testing.


I think the documentation here doesn't describe the bar history requirement well enough. Minimum 100 bars before the test start date is a very old requirement. The article is from 2011, and this tester behavior is indeed very old.

 
@Anton #The test period is from 2025.06.25 to 2025.06.30, and the test start time is shifted to 2025.08.19. I think the documentation here doesn't describe the bar history requirement well enough. Minimum 100 bars before the test start date is a very old requirement. The article is from 2011, and this tester behavior is indeed very old.

Your explanation seems to explain the issue, but the logic behind MetaQuotes' decision to apply such a limitation on the tester seems short sighted. It would make better sense to allow the testing to take place anyway and simply issue a warning about the low quantity of available data, instead of "forcing" the a shift in the testing period, especially when the EA may not be using indicators at all.

In this case, where the futures contract in question has a short duration of mere months, this limitation of 100 days (just over 3 months), makes testing almost impossible on the Daily chart.

The workaround that I found, is to test using the "Hourly" selection instead, and simply reading the daily data anyway. So why impose such a limitation?

 
Alain Verleyen # :
It's a bug or at least an undocumented limitation, and you make a fool of yourself publicly.

You shouldn't publicly insult the platform developers. The help says https://www.metatrader5.com/en/terminal/help/algotrading/testing_features#multicurrency

The Strategy Tester allows backtesting strategies that trade multiple symbols. Such EAs are conventionally referred to as multi-currency Expert Advisors, since originally, in the previous platforms, testing was performed only for a single symbol. In the platform tester, we can model trading for all the available instruments.

The tester automatically downloads the history of required symbols from the trading platform (not from the trade server!) during the first call of the symbol data.

The testing agent downloads only the missing history data and a little more to provide the required data for the indicator calculation at the beginning of testing. For the timeframes D1 and below, the minimum volume of the downloaded history is one year. Thus, for a one-month testing on an interval of 2010.11.01-2010.12.01 with a period of M15 (each bar is equal to 15 minutes), the agent requests the symbol history for the entire year of 2010 from the platform. For the one-week timeframe, the agent requests a history of 100 bars, which is about two years (a year has 52 weeks). For testing on a monthly timeframe, the agent requests the history for 8 years (12 months * 8 years = 96 months).

If the required bars are not available for whatever reason, the starting date of testing is automatically shifted from the past to the present to provide the necessary amount of bars.

Anyone who tests strategies should understand that many indicators require a preliminary history to calculate correctly, so that the indicator values are correct at the start of testing. Therefore, the tester tries to ensure such a reserve of history and indicator values at the start of testing.

In short: the MT5 tester deliberately “rewinds” the start back to load the necessary history. Otherwise, the advisor/indicators will not be able to correctly calculate on the first bars.

Here are the main reasons why this happens:

Warming up indicators and MTF

  • If the robot/indicators have periods (MA 200, RSI 14, iBands 20, etc.), the tester needs at least these N bars BEFORE your “From” date to fill the buffers.
  • If you use higher TFs (for example, an advisor on M15, and inside iMA(H1, period 200)), the tester will load even more history: period * size of the higher TF.
  • Custom iCustoms can pull even earlier data (and for other symbols).


Multi-symbol strategies


When accessing other instruments (correlation, spreads, filters), the tester loads the history for them as well - also with a reserve, due to which the general start may shift forward.


Bottom line: this is normal tester behavior. It does not "make a mistake", but creates a history buffer for correct initialization of indicators/data.

Testing Features - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
Testing Features - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
  • www.metatrader5.com
The idea of automated trading is attractive because a trading robot can work non-stop for 24 hours a day and seven days a week. The robot is...
 
Fernando Carreiro # :

In this case, where the futures contract in question has a short duration of mere months, this limitation of 100 days (just over 3 months), makes testing almost impossible on the Daily chart.

The workaround that I found, is to test using the "Hourly" selection instead, and simply reading the daily data anyway. So why impose such a limitation?

Think again carefully, taking into account my answer above.

Don't think you're smarter than developers who have been writing terminal and tester code for over 20 years.

 
Rashid Umarov #Think again carefully, taking into account my answer above. Don't think you're smarter than developers who have been writing terminal and tester code for over 20 years.
I humbly disagree completely with your statement.
 
Alain Verleyen #AMP is not the only broker to trade U.S. Futures.

Correct. It is the only U.S. Futures broker with a dedicated Forum thread on mql5.com, i.e.,:

Ryan L Johnson #The only real U.S. Futures broker posted by MQ elsewhere in this Forum... AMP.