wrong timeframe request error

 

Hi, why on the following do i get error "wrong timeframe request in open prices testing mode error" when i test on the 15m timeframe?

double lowprice_i=iLow(_Symbol,(ENUM_TIMEFRAMES)5,iLowest(_Symbol,(ENUM_TIMEFRAMES)5,MODE_LOW,11,1));

How do you look at different timeframes in mql5?

Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Price Constants - Indicator Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
You can cast an int to an ENUM, but how do you know it is the right value?


 
Exactly. Don't use numbers.
(ENUM_TIMEFRAMES)5
use the proper enumerations
PERIOD_M5
 
William Roeder #:
Exactly. Don't use numbers. use the proper enumerations
double lowprice_i=iLow(_Symbol,PERIOD_M5,iLowest(_Symbol,PERIOD_M5,MODE_LOW,Amplitude,1));

I tried this but it is still the same problem?

 

Is it maybe because you cannnot access different data in " in open prices testing mode"

To be honest, I am guessing....

Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Price Constants - Indicator Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Dominik Egert #:

Is it maybe because you cannnot access different data in " in open prices testing mode"

To be honest, I am guessing....

From the following post https://www.mql5.com/en/forum/15858 i now realise as stated : 

"In the tested Expert Advisor, you cannot access data of the timeframe lower than that used for testing/optimization. These limitations are connected with the impossibility to obtain data of lower or non-multiple timeframes out of the bars generated during testing/optimization"

How do you get around this problem? Theres a bug in the function so i cant look at lower timframes?

Bear in mind its only when i test in open prices mode the everytick appears to work?

ERROR wrong timeframe request in Open Prices testing mode
ERROR wrong timeframe request in Open Prices testing mode
  • 2013.11.30
  • www.mql5.com
Dear developers! I continue to get the error "wrong timeframe request in Open Prices testing mode...
 
Stephen Reynolds #: Bear in mind its only when i test in open prices mode

So stop using it.