MQL4 and SeriesInfoIngteger

 

This code:

data.ThisTimeStamp[i] = (datetime) SeriesInfoInteger(data.symbol[i],data.ThisTF[i],SERIES_LASTBAR_DATE);

It will only return the correct value if the corresponding chart is open in the terminal. Otherwise it returns zero. 

The format

Makes developing multicurrency EA:s cumbersome.

The MQL4 Reference available from MetaEditor does not specify this requirement

The other format does not return false and the datetime is also zero

if(SeriesInfoInteger(data.symbol[i],data.ThisTF[i],SERIES_LASTBAR_DATE,lw)== false)

 
Ingvar Engelbrecht:

This code:

data.ThisTimeStamp[i] = (datetime) SeriesInfoInteger(data.symbol[i],data.ThisTF[i],SERIES_LASTBAR_DATE);

It will only return the correct value if the corresponding chart is open in the terminal. Otherwise it returns zero.

Seems an MT4 bug, not ?

The format

Makes developing multicurrency EA:s cumbersome.

What do you mean ? Not clear to me.

The MQL4 Reference available from MetaEditor does not specify this requirement

So it's a bug ;-)

The other format does not return false and the datetime is also zero

if(SeriesInfoInteger(data.symbol[i],data.ThisTF[i],SERIES_LASTBAR_DATE,lw)== false)

Why not use ?

 CopyTime(data.symbol[i],data.ThisTF[i],0,1,lastbar);
 
Alain Verleyen:
Seems an MT4 bug, not ?
What do you mean ? Not clear to me.
So it's a bug ;-)

First I just tried to get some data in MQLRates. That was not enough

Then I picked the datetime from the most recent bar in MQLRates

Problem solved.


I guess your suggestion is more efficient  :-)