MQL4 Problem with simple function (Order open...) - page 2

 
grgr:

Now i have problem with iMA.

LongH1 is defined, it's in a loop.

However, it works for n = 263, but then (like n = 950) it returns 0 .. I have no idea why ?

Higrgr,

Write it like this ;

int LongH1 = 50;   
for(int n=1;n<Bars;n++)
  {
  Print(Bars," | ",n," | ",DoubleToStr(iMA(NULL,PERIOD_H1,LongH1,0,MODE_SMA,PRICE_TYPICAL,n), Digits));
  }

If there are 1000 Bars and MA period is 50, then the iMA will return value until bar 950. if there are 777 Bars and MA period is 17 then iMA will return value until bar 760.

:D

Reason: