Topic: EA MACD Error Message
Hi,
I'm getting the following error when loading some Portfolio EAs in MT5:
cannot load indicator 'MACD' [4002]
What's the problem ? Will the EA not work correctly when using MACD as entry/exit ?
Create and Test Forex Strategies
You are not logged in. Please login or register.
Forex Software → Expert Advisor Studio → EA MACD Error Message
Hi,
I'm getting the following error when loading some Portfolio EAs in MT5:
cannot load indicator 'MACD' [4002]
What's the problem ? Will the EA not work correctly when using MACD as entry/exit ?
> Will the EA not work correctly when using MACD as entry/exit ?
The EAs are working correctly with the MACD indicator for at least six years.
The problem should be other.
Please attach your expert for a test, and we will find and solve the problem.
I attached some of the EAs where I get the error.
Both experts compile, test, and run on an MT chart without errors.
Please post screenshots of the issues you experience.
See attached file.
I'm getting this error on 2 different brokers.
Hi @felix-brenkel you're welcome to the forums! I would like to point out that there appears to be an error in the code or configuration.
// MACD (Close, 34, 66, 0)
indHandlers[2][1][0] = iMACD(NULL, 0, 34, 66, 0, PRICE_CLOSE);
Fast EMA: 34
Slow EMA: 66
MACD SMA: 0
// MACD (Close, 30, 44, 0)
indHandlers[0][1][0] = iMACD(NULL, 0, 30, 44, 0, PRICE_CLOSE);
Fast EMA: 30
Slow EMA: 44
MACD SMA: 0
It seems that when calling the MACD (Moving Average Convergence Divergence) indicator, the MACD SMA (Simple Moving Average) values are set to 0. However, it is important to note that the MACD SMA should be >=2 for the indicator to function correctly.
I recently exported a portfolio expert using the MACD indicator on the MQL5 platform, and the export process went smoothly with all the values intact. However, I am puzzled as to why your source code has exported the MACD SMA values as 0. It would be beneficial for you, @Popov, to review the minimum period for MACD SMA used in the generator. It is possible that the expert advisor was generated with the parameter set to 0 for MACD SMA, leading to this discrepancy.
@viniq
Thanks for your reply.
I'm using Express Generator & afterwards EA Studio to generate the Portfolio EAs. I do not touch any Code.
So it must be a problem of the generation process ?
Added 15 and 9 to iMACD as shown: iMACD(NULL, 15, 30, 44, 9, PRICE_CLOSE);
Now EA loads onto MT5 chart with no errors shown in MT5 Experts tab at bottom of price chart.
So all you need to do is open the MT5 Editor and add the correct 'period' and 'signal period' by replacing the two zeros and press the Compile button and you should be able to use the EA's.
Evidently Express Generator is not adding the 'period' and 'signal period' to the source code of iMACD when saving strategy as an EA.
This problem should result from an earlier bug where the min indicator period could become 0 or negative. Popov fixed it already and newly created EAs should not show this problem anymore.
Forex Software → Expert Advisor Studio → EA MACD Error Message
Powered by PunBB, supported by Informer Technologies, Inc.