Help Expert Advisor

 

Good morning.

I am extremely happy I have just finished my trading EA. On the other hand on the indicator MACD, I am getting an awkward error ("MACD"  [4002] -   "Wrong parameter in the inner call of the client terminal function"). What does that even mean?

Thanks for your attention.


Kind regards

Pedro

 
PedroCamargo:

Good morning.

I am extremely happy I have just finished my trading EA. On the other hand on the indicator MACD, I am getting an awkward error ("MACD"  [4002] -   "Wrong parameter in the inner call of the client terminal function"). What does that even mean?

Thanks for your attention.


Kind regards

Pedro

Please show the relevant code.
 

input




int Oninit () { maHandle = iMA (NULL, 0, MA_Period,0, MODE_EMA,PRICE_CLOSE); MACD_handle= iMACD (NULL, 0, MA_Period, MODE_EMA,PRICE_CLOSE); if (maHandle <0 || MACD_handle <0) {   Alert ("Error creation of indicator - error: ", GetLastError (), "!!"); return (0); } STP=StopLoss; TKP=TakeProfit; return(0); }

 

Just fixed the error now

Correct code for the MACD and MA is

maHandle = iMA (_Symbol,_Period, MA_Period,0, MODE_EMA,PRICE_CLOSE);
MACD_handle= iMACD (_Symbol,_Period,fastEMAPeriod,slowEMAPeriod,signal_Period, ,PRICE_CLOSE);
 
PedroCamargo:

Just fixed the error now

Correct code for the MACD and MA is