Help about MA of another MA!

 

Hello.

Pls if somebody can help me:

On MQL5 we use handles and we can calculate an MA of another MA:

   //set handler for used indicators
   emaA = iMA(NULL, MA_TF, EmaPeriod1, 0, MODE_EMA, PRICE_WEIGHTED);
   emaA2 = iMA(NULL, MA_TF, EmaPeriod2, 0, MODE_EMA, emaA);

On MQL4 i try this:

         emaA = iMA(NULL, MA_TF, EmaPeriod1, 0, MODE_EMA, PRICE_WEIGHTED, 0); emaAx = NormalizeDouble(emaA, _digits);
         emaA2 = iMA(NULL, MA_TF, EmaPeriod2, 0, MODE_EMA, emaA, 0); emaA2x = NormalizeDouble(emaA2, _digits);
and i see the warning: "possible loss of data due to type conversion AIC.mq4 281 62"


Probably it does not accept other indicator on "ENUM_APPLIED_PRICE" place of iMA command.

How can I do it??

Thanks!

PS: I see on new MQL4 that I can select all timeframes as on MQL5!! Is this true????? Can I use 2, 3, 4 etc. minutes TF???????????

 
chronisb:

Hello.

Pls if somebody can help me:

On MQL5 we use handles and we can calculate an MA of another MA:

On MQL4 i try this:

and i see the warning: "possible loss of data due to type conversion AIC.mq4 281 62"


Probably it does not accept other indicator on "ENUM_APPLIED_PRICE" place of iMA command.

How can I do it??

Thanks!

PS: I see on new MQL4 that I can select all timeframes as on MQL5!! Is this true????? Can I use 2, 3, 4 etc. minutes TF???????????

Check documentation of iMA() please.
 
angevoyageur:
Check documentation of iMA() please.



Thanks for your answer.

Of course I had read both 4 and 5 Docs

MQL4:

applied_price

[in] Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.

MQL5:

applied_price

[in] The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.

This is the reason that I ask IF I can take a MA of another MA in MQL4!!! Pls, Can you help me if I can do it???

Thanks.


 
chronisb:


This is the reason that I ask IF I can take a MA of another MA in MQL4!!! Pls, Can you help me if I can do it???

Thanks.

You can use iMAOnArray()
 
SDC:
You can use iMAOnArray()


Thank you very much!! I'll look for it!