Download MetaTrader 5

ERROR wrong timeframe request in Open Prices testing mode

To add comments, please log in or register
Publish your article. Millions of traders are looking for good ideas!
Roman Pritulyak
13674
Roman Pritulyak 2013.11.30 13:05 

Dear developers!

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). 

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
Files:
IndexUSD.mq5 3 kb
journal.PNG 25 kb
journal_2.PNG 17 kb
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.11.30 13:25  
Can you provide a sample EA which helps to reproduce the problem ?
Roman Pritulyak
13674
Roman Pritulyak 2013.11.30 18:17  
The error occurs or doesn't ocuur randomly, as I see it.
Files:
TEST.mq5 2 kb
No1.PNG 16 kb
No2.PNG 16 kb
SingleRun.PNG 38 kb
IndexCHF.mq5 3 kb
IndexUSD.mq5 3 kb
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.11.30 21:16  
c1664:
The error occurs or doesn't ocuur randomly, as I see it.

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.

Roman Pritulyak
13674
Roman Pritulyak 2013.12.01 11:31  

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.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
Files:
TEST.mq5 1 kb
20131201.log 24 kb
Roman Pritulyak
13674
Roman Pritulyak 2013.12.01 11:44  

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. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
Alain Verleyen
Moderator
30721
Alain Verleyen 2013.12.01 17:58  
c1664:

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 :

   if(CopyOpen("EURUSD",Inp_timeframe,0,1,buffer_1)!=1)
      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.

david mackay
2212
david mackay 2015.02.27 00:01  

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.

To add comments, please log in or register