Anyone knows how to deal with Error 4002?
-
here is solution from chatgpt.
Error 4002 in an expert advisor (EA) for the MetaTrader 5 (mq5) platform typically indicates that the EA is trying to access an object that does not exist. This can happen if the EA is trying to access an indicator or custom object that is not present on the chart, or if the object's name has been misspelled. To resolve this error, ensure that the object being accessed by the EA is properly installed and configured on the chart, and that the EA is referencing the correct name for the object. Also, check if the expert advisor is using the correct version of the indicator or custom object and if it is in the correct folder, if not place the correct version in the correct folder.
-
Ok here is solution:

indicator have this blank value, so what you must do is, open your ea.mq5 and find your indicator in source code and add all blank spot, in my case i have added 5.
original file :
StringConcatenate(key, Symbol, Period, "Four MA on OBV" , (int)20, (int)0, (ENUM_MA_METHOD)MODE_SMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, (int)50, (int)0, (ENUM_MA_METHOD)MODE_SMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, (int)1000, (int)0, (ENUM_MA_METHOD)MODE_EMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, (int)500, (int)0, (ENUM_MA_METHOD)MODE_EMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, (ENUM_APPLIED_VOLUME)VOLUME_TICK);after modification:
StringConcatenate(key, Symbol, Period, "Four MA on OBV" , "" , (int)20, (int)0, (ENUM_MA_METHOD)MODE_SMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, "" , (int)50, (int)0, (ENUM_MA_METHOD)MODE_SMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, "" , (int)1000, (int)0, (ENUM_MA_METHOD)MODE_EMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, "" , (int)500, (int)0, (ENUM_MA_METHOD)MODE_EMA, (ENUM_APPLIED_PRICE)PRICE_CLOSE, "" , (ENUM_APPLIED_VOLUME)VOLUME_TICK); -
@byens Thank you for sharing.