I continue to get the error "wrong timeframe request in Open Prices testing mode". All the testing is provided in "Open prices only" mode EXCLUSIVELY on M1 timeframe. I actually test the EA, in which timeframe of the loaded custom indicator is set as an input parameter. Because I use M1 as main timeframe, I expect to be able to load indicators from all other timeframes (according to this https://www.mql5.com/en/forum/6494 ), and that goes smoothly with all my other indicators. However, I get this error even when the indicator timeframe is set to M1.
Moreover, the error condition is unstable, e.g. sometimes I get it and sometimes not. For example. I start the slow optimisation and about half of the passes return this error, while others do not. When I run the same optimisation with same inputs ranges without recompiling any EAs or indicators, I get other confings, which return error (and sometimes all the testing goes smoothly). When I try to make a single run of a config. which returned the error, it sometimes goes smoothly too. Usually, the restart of the terminal changes the situation.
I pin the code of the indicator, which causes the error (line 60 mainly).
I don't have any problem. Are all the symbols used by your IndexXXX indicators selected in Market Watch ?
I run it with Metaquotes-demo server.
OK, let's make it even more simple - down to single function.
EURUSD is selected in MarketWatch. I run it on USDCHF, M1, Normal, Open prices only.
Tested it in 3 different terminals with the same result.
There is evidently a bug in functions for copying rates from other symbols in "Open prices only" mode.
Ok, I got it. The error is only with "Open prices only" mode. Also if I run a "1 minutes OHLC" first, and then "Open prices only" I don't get errors.
I don't know about your original code, but the code you posted here don't have error processing, I strongly suggest you to include error processing everywhere. For example with this code :
Print("CopyOpen Error : ",_LastError);
I got error 4401 which is "Requested history not found", each time you see "wrong timeframe request..." in the Strategy Tester logs.
Anyway, that seems weird to have this error with the Strategy Tester, if your wrote to ServiceDesk to report this, please let us know their answer.
I have this same error appear..... and I have resolved it by switching as you indicated......
I can send to the service desk a letter, however, I di not write the ea that I am using so I am unable to add any code to it.