Make sure the Indicator is placed in teh correct directory as described in the documentation of iCustom:
- www.mql5.com
Make sure the Indicator is placed in teh correct directory as described in the documentation of iCustom:
Hi Mathias
yes the indicator is in correct folder / directory and path is also defined correctly.
as I am using the same folder / path for another couple of other indicators and they all are working fine.
You have to study how Metatrader file sandbox looks like and how to reference files.
Do your includes work at all? Especially that one which starts with "C:\..." and those that start with "\..\".
Anyway, this is wrong:
m_IndicatorName = "Final Version\\iFx VW_3EMAs.mqh";
Here you have at least two problems:
- you can't use extension mqh, it's ex5
- if you call this from an expert, "m_indicatorname" without backslash character at the beginning would be appended to the current folder and indicator name as you wrote it resolves to:
Your indicator is in "Indicators" folder, probably something like this:
\Indicators\{some folder}\Final Version\iFx VW_3EMAs.ex5
You have to study how Metatrader file sandbox looks like and how to reference files.
Do your includes work at all? Especially that one which starts with "C:\..." and those that start with "\..\". SORTED OUT WITH"\..\..\xxxx i.e. going 2 steps behind in directory path
Anyway, this is wrong:
Here you have at least two problems:
- you can't use extension mqh, it's ex5
- if you call this from an expert, "m_indicatorname" without backslash character at the beginning would be appended to the current folder and indicator name as you wrote it resolves to:
\Experts\{some folder where your expert is}\Final Version\iFx VW_3EMAs.mqh
Your indicator is in "Indicators" folder, probably something like this:
Thanks a lot Drazen for your reply.
removing extension mqh, (what a silly mistake) worked and CLASS and EA is working now.
about the second part of your answer, the result differs.
************************************************************************************************
My EA Location : MQL5\Experts\AKTAdvisor\Testing EAs\EATest iVW 3EMAs.mq5
My CLASS Location : MQL5\Experts\AKTAdvisor\Indicator\CiVW_3EMAs.mqh
My Indicator Location : MQL5\Indicators\Final Version\iFx VW_MACD.ex5
************************************************************************************************
I am not sure why, but the following call in CLASS CiVW_3EMAs.mhq and than initialization of this class into EATest iVW_3EMAs.mqh is working well for this as well as for few other Classes I have created.
m_IndicatorName = "Final Version\\iFx VW_3EMAs"; // without file extension
Include statement in EATest iVW_3EMAs.mq5 is as below
#include "\..\Indicator\CiVW_3EMAs.mqh"
Currently this set up working well, except my silly mistake of adding file extension to IndicatorName.
However, I am open to learn better ways of coding and save time in future with errors. Your suggestion for structure array really helped me a lot, and I almost revising few of my initial work on those lines.
It is really having impact on my EA with less number of arrays to handle and less calls to different indicators. I have successfully merged 3 Indicator calls 1) %b, 2) %MFI and 3) %RSI into one single CLASS with following structure.
struct struct_NormBMR { double NormBB; double NormMFI; double NormRSI; } struct_NormBMR = sM05_NormBRM[];
Once again thanks a lot for your guidance and hopeful to receive them in future too.
regards
Forum on trading, automated trading systems and testing trading strategies
Problem to load indicators in EA after new version 5.0 build 2949 28 may 2021
Vladimir Karputov, 2021.05.31 16:51
Check version 2950 - iCustom now (and even with the help of a resource) works for me.
Thanks Vladimir
iCustom now (and even with the help of a resource) works for me. !!! What you mean by this ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
UPDATE ... the issue is resolved, I was adding file extension in iCustom Indicator Name. Once removed it, it works well.
Dear Forum Members
It is never easy to use iCustom function in MQL5.
Please help me to debug why I am getting error 4802.
I have checked all the input variables of the indicator, nothing seems to be missing. Indicator .ex5 is attached for convenient debugging of Class and Test EA.
Indicator INPUT parameters ...
CLASS to use the custom Indicator ...
class CiVW_3EMAs { private: //--- class variable for parameters string m_Symbol; ENUM_TIMEFRAMES m_TimeFrame; int m_HandleEMA; // Indicator handle string m_IndicatorName; // iCustom needs Custom Indicator name located in Indicator folder //--- Parameters for Exponential Moving Average(s) int m_MAPeriod_Fastest; // Fastest Averaging Period int m_MAPeriod_Fast; // Fast Averaging Period int m_MAPeriod_Slow; // Slow Averaging Period enum_APPLIED_PRICE m_AppliedPrice; // Applied Price TYPE bool m_VolumeReal; // true = 'real' / false 'tick' volume type //--- //CLog* m_log; // Logging public: //--- Parametric Contstructor and default Destructor methods CiVW_3EMAs(string pSymbol,ENUM_TIMEFRAMES pTimeFrame,int pMAPeriodFastest,int pMAPeriodFast, int pMAPeriodSlow,enum_APPLIED_PRICE pAppliedPrice); ~CiVW_3EMAs(void); void Init_Handle(void); //--- Specific methods to get values from Custome Indicator 'iFx VW_3EMAs' bool Get_3EMA(const int pBarCount,s_3EMA &psa3EMA); // with StructureArray //bool Get_3EMAs(const int pBarCount,double &pEMAFastest[],double &pEMAFast[],double &pEMASlow[]); //bool Get_EMAFastest(const int pBarCount,double &pEMAFastest[]); }; CiVW_3EMAs::CiVW_3EMAs(string pSymbol,ENUM_TIMEFRAMES pTimeFrame,int pMAPeriodFastest,int pMAPeriodFast, int pMAPeriodSlow,enum_APPLIED_PRICE pAppliedPrice) { m_Symbol = pSymbol; m_TimeFrame = pTimeFrame; m_IndicatorName = "Final Version\\iFx VW_3EMAs.mqh"; m_MAPeriod_Fastest = pMAPeriodFastest; m_MAPeriod_Fast = pMAPeriodFast; m_MAPeriod_Slow = pMAPeriodSlow; m_AppliedPrice = pAppliedPrice; m_VolumeReal = false; // 'false' default volume Type set as Tick Volume //m_log = CLog::GetLog(); } // END Of CiVW_3EMAs()
Error message ...
2021.05.28 16:39:59.621 EATest iVW_3EMAs (US30,M5) CiVW_3EMAs::Init_Handle: Error Creating iFx VW_3EMAs handle. Code 4807
2021.05.28 16:39:59.622 EATest iVW_3EMAs (US30,M5) cannot load custom indicator 'Final Version\iFx VW_3EMAs.mqh' [4802]
Test EA Code
<*.ex* file deleted>