Problems with iMA()

 

Hello,

I`m working on my first EA and I have got several Problem solved but this one still appears.

What I`m trying is to show the iMA() as a comment programmed in a for loop in the start() function of the EA.

Well it appears on the corner but once in a while the value drops to zero.

When I do it with the Print command Print("iMA()",iMA(...)) it doesn`t drop to zero unitl I add showing some other parameters. In this case the iMA() also drop down to zero.

I used int counted_bars=IndicatorCounted();
but without the if(counted_bars<0) return(-1); because it seems like the programm will stop at this line.

I hope this is an easy problem for you guys.

Greets

AlexDoe

Reason: