MQL4 - automated forex trading   /  

Forum

MA_Shift negative value works?

Back to topics list To post a new topic, please log in or register

avatar
8
jjperellos 2007.07.16 01:54 

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.

article

Interview with Olexandr Topchylo (Better)

Olexandr performed unsuccessfully in the last-year Championship, and this failure was the making of him. He learned his lesson and became the leader of Championship 2007 with a huge equity!


avatar
1515
DxdCn 2007.07.16 06:19 

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.

Back to topics list  

To add comments, please log in or register