how to make sure ea can load enough data from history?

 

for example.

i use a indicator ma

double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)

i want get ima(.......,shift =1000)

almost i can't get that,that will make a error, then ea can't keep working.

how to make sure i can get that data ?

thank you.

 

If you just want to know if you have enough data...

int start(){

if(Bars < 1000){

Alert("Need 1000 bars, only have", Bars);

return(0);

}

...

...

...

return(0);

Reason: