MA_Shift negative value works?

 

Hi all,

I have this EMA:

double MA=iMA(NULL,0,2,-3,MODE_EMA,PRICE_TYPICAL,0);

If I set a negative value in MA_Shift (-3 in my case), in the EA my MA value is 0. Why?

Could you help me about this?

Thanks.

 

negative value means future. here means draw at shift -3 position.

for your case, you only can calculate to shift=3, then can draw at position 0.

double MA=iMA(NULL,0,2,-3,MODE_EMA,PRICE_TYPICAL,0);

means iMA at shift =0 will draw at shift =-3, but MT only draw to shift =0. this parameter only effects sraw position.

For EA, this is same with double MA=iMA(NULL,0,2,0,MODE_EMA,PRICE_TYPICAL,0); it is needn't use MASHIFT parameter for EA.

Reason: