MT4 strategy test iclose iopen ihigh ilow always 0

 

Hi all,

 English is not my native language, but i try to explain what i want to say ...

 I do strategy test on M15 and i want to get price on other timeframe. ex: H4, D1....

 iclose, iopen, ihigh and ilow are always 0 on other timeframe...Why?

 there is a problem during 2007~2014 only, but it will become normal after 2015 (i can get close, open high and low)

 It's so tricky...

Sorry for my poor english :(

Any suggestion will be appreciated :) 


 
There are no mind reader here.
  1. Do you have history for the other timeframes? Do you Print the _LastError so you can find out?
  2. Post your broken code. Likely You are mixing apples and oranges
 
WHRoeder:
There are no mind reader here.
  1. Do you have history for the other timeframes? Do you Print the _LastError so you can find out?
  2. Post your broken code. Likely You are mixing apples and oranges
Thanks your reply

Do you have history for the other timeframes?  no ,  but i consider that MT4 can model on different timeframe of a symbol tested...

There's my code, I't just print data...

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
  
   int M15NewBars = 0;

   
   M15NewBars = M15Chart.isNewBar();
   if (M15NewBars) {
   Print("My time frame   "," Open=",Open[1],"  High=",High[1],"   Low=",Low[1],"  Close=",Close[1],"  Volume=",Volume[1],"  Bid=",Bid);
   Print("30 minute frame "," Open=",iOpen(NULL,PERIOD_M30,1),"  High=",iHigh(NULL,PERIOD_M30,1),"   Low=",iLow(NULL,PERIOD_M30,1),"  Close=",iClose(NULL,PERIOD_M30,1),"  Volume=",iVolume(NULL,PERIOD_M30,1),"  Bid=",Bid);
   Print("1 hour frame    "," Open=",iOpen(NULL,PERIOD_H1,1),"  High=",iHigh(NULL,PERIOD_H1,1),"   Low=",iLow(NULL,PERIOD_H1,1),"  Close=",iClose(NULL,PERIOD_H1,1),"  Volume=",iVolume(NULL,PERIOD_H1,1),"  Bid=",Bid);
   Print("4 hour frame    "," Open=",iOpen(NULL,PERIOD_H4,1),"  High=",iHigh(NULL,PERIOD_H4,1),"   Low=",iLow(NULL,PERIOD_H4,1),"  Close=",iClose(NULL,PERIOD_H4,1),"  Volume=",iVolume(NULL,PERIOD_H4,1),"  Bid=",Bid);

   counter++;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Logs EA printed

==================================fail on 2007~2014========================================= 

3 10:45:16.280 TestGenerator: file "C:\Users\samuel\AppData\Roaming\MetaQuotes\Terminal\50CA3DFB510CC5A8F28B48D1BF2A5702\tester\history\USDJPY15_0.fxt" is read-only

3 10:45:18.942 TestGenerator: symbol USDJPY period 15 model 0 from 2007.01.01 to 2016.05.20

2 10:45:22 2007.08.01 00:00  CheckModelling inputs: DayS=21; MonthS=4; YearS=2006; HourS=22; MinuteS=30; CounterS=20; 

0 10:45:22 2007.08.01 00:15  CheckModelling USDJPY,M15: My time frame    Open=118.45  High=118.49   Low=118.43  Close=118.48  Volume=807  Bid=118.48

0 10:45:24 2007.08.01 00:15  CheckModelling USDJPY,M15: 30 minute frame  Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.48

0 10:45:26 2007.08.01 00:15  CheckModelling USDJPY,M15: 1 hour frame     Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.48

0 10:45:28 2007.08.01 00:15  CheckModelling USDJPY,M15: 4 hour frame     Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.48

0 10:45:28 2007.08.01 00:30  CheckModelling USDJPY,M15: My time frame    Open=118.48  High=118.48   Low=118.39  Close=118.41  Volume=1220  Bid=118.41

0 10:45:28 2007.08.01 00:30  CheckModelling USDJPY,M15: 30 minute frame  Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.41

0 10:45:28 2007.08.01 00:30  CheckModelling USDJPY,M15: 1 hour frame     Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.41

0 10:45:28 2007.08.01 00:30  CheckModelling USDJPY,M15: 4 hour frame     Open=0  High=0   Low=0  Close=0  Volume=0  Bid=118.41 

...

===================================success on 2016, but M30 still can't get the price...============================================== 


0 10:46:26 2016.04.13 16:30  CheckModelling USDJPY,M15: My time frame    Open=109.288  High=109.306   Low=109.222  Close=109.306  Volume=1106  Bid=109.305
0 10:46:26 2016.04.13 16:30  CheckModelling USDJPY,M15: 30 minute frame  Open=0  High=0   Low=0  Close=0  Volume=0  Bid=109.305
0 10:46:26 2016.04.13 16:30  CheckModelling USDJPY,M15: 1 hour frame     Open=109.347  High=109.372   Low=109.05  Close=109.115  Volume=6370  Bid=109.305
0 10:46:26 2016.04.13 16:30  CheckModelling USDJPY,M15: 4 hour frame     Open=109.177  High=109.386   Low=109.05  Close=109.115  Volume=20165  Bid=109.305
0 10:46:26 2016.04.13 16:45  CheckModelling USDJPY,M15: My time frame    Open=109.305  High=109.405   Low=109.278  Close=109.279  Volume=1435  Bid=109.278
0 10:46:26 2016.04.13 16:45  CheckModelling USDJPY,M15: 30 minute frame  Open=0  High=0   Low=0  Close=0  Volume=0  Bid=109.278
0 10:46:26 2016.04.13 16:45  CheckModelling USDJPY,M15: 1 hour frame     Open=109.347  High=109.372   Low=109.05  Close=109.115  Volume=6370  Bid=109.278
0 10:46:26 2016.04.13 16:45  CheckModelling USDJPY,M15: 4 hour frame     Open=109.177  High=109.386   Low=109.05  Close=109.115  Volume=20165  Bid=109.278
0 10:46:26 2016.04.13 17:00  CheckModelling USDJPY,M15: My time frame    Open=109.278  High=109.289   Low=109.198  Close=109.214  Volume=1129  Bid=109.214
0 10:46:26 2016.04.13 17:00  CheckModelling USDJPY,M15: 30 minute frame  Open=0  High=0   Low=0  Close=0  Volume=0  Bid=109.214
0 10:46:26 2016.04.13 17:00  CheckModelling USDJPY,M15: 1 hour frame     Open=109.115  High=109.167   Low=109.016  Close=109.1  Volume=7230  Bid=109.214
0 10:46:26 2016.04.13 17:00  CheckModelling USDJPY,M15: 4 hour frame     Open=109.177  High=109.386   Low=109.05  Close=109.115  Volume=20165  Bid=109.214

....

any idea ? :(

 
shuenmeau: Do you have history for the other timeframes?  no  but i consider that MT4 can model on different timeframe of a symbol tested...
Then how do you expect MT4 to give them to you? Timeframes below your M15 have been modeled in the tester, not the higher ones.
 
WHRoeder:
shuenmeau: Do you have history for the other timeframes?  no  but i consider that MT4 can model on different timeframe of a symbol tested...
Then how do you expect MT4 to give them to you? Timeframes below your M15 have been modeled in the tester, not the higher ones.

um....Because I found the article https://www.mql5.com/en/articles/1490 

It's mentioned:

The tester in MetaTrader 4 allows seeing not only the tested timeframe, but also other - higher and lower - timeframes. Thus, if we test an Expert Advisor on the timeframe EURUSD M15, we can see the values of the indicators for EURUSD H1 or EURUSD M5.

Actually, It's all good before... I don't know why it's not work suddenly... And you can see that EA can get close price in 2016 .

I also download H1 and H4 history, it seems not to be working ...
Reason: