Download MetaTrader 5

MQL4 and SeriesInfoIngteger

To add comments, please log in or register
Write articles, help other developers and make money
Ingvar Engelbrecht
4504
Ingvar Engelbrecht 2015.05.22 18:24 

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)

Alain Verleyen
Moderator
30721
Alain Verleyen 2015.05.22 18:53  
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);
Ingvar Engelbrecht
4504
Ingvar Engelbrecht 2015.05.22 22:16  
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  :-)

To add comments, please log in or register