Accessing hitory data

 

I refer to history data on a pair that does not have a window open, the EA runs on another pair. Is the history data updated continouisly on that other pair or do I have to

have a window open on that other pair too?

 
ingvar_e:

I refer to history data on a pair that does not have a window open, the EA runs on another pair. Is the history data updated continouisly on that other pair or do I have to

have a window open on that other pair too?


OHLC price is only updated automatically on the symbols and time-frames in the current open profile.

When using values from other time-frames or symbols, you need to check that the history has been updated.

 
ingvar_e:

I refer to history data on a pair that does not have a window open, the EA runs on another pair. Is the history data updated continouisly on that other pair or do I have to

have a window open on that other pair too?

If you try to access the data it will be updated . . . but you need to wait for it to be updated if it's currently not up to date . . . then access it again. Error 4066 tells you if the data needed to be updated . . .
 

Interesting.

this is what I do:

--- snip ---

for(int i=0; i<220;i++)
{
Long_MA[i] = iMA(Pair,PERIOD_H1, period_long_new,0,MODE_MINE,PRICE_CLOSE,i);
Shrt_MA[i] = iMA(Pair,PERIOD_H1, period_shrt_new,0,MODE_MINE,PRICE_CLOSE,i);
Diff_MA[i] = Shrt_MA[i] - Long_MA[i];

}

--- snip ---

Should I try the following in a loop?

work = iMA(Pair,PERIOD_H11,period_long_new,0,MODE_MINE,PRICE_Close,219)

and test for lastError until it is ok and then do the real loop to fill my array

 
ingvar_e:

Interesting.

this is what I do:

Search the forum for 4066 sort by date and read . . . there is plenty of information.
Reason: