ICustom - wrong parameters count

 

Hi all, I was implementing in a code an external/custom indicator, with related external inputs, but the icustom gives me error saying they are wrong

ICustom - wrong parameters count

double test=iCustom(NULL,0,TDI_INDI,RSI_Period,RSI_Price,Volatility_Band,RSI_Price_Line,RSI_Price_Line_Shift,RSI_Price_Type,Trade_Signal_Line,Trade_Signal_Line_Shift,Trade_Signal_Type,Trade_Signal2_Line,Trade_Signal2_Line_Shift,Trade_Signal2_Type,SHOW_Trade_Signal2_Line,RSI_OversoldLevel,RSI_OverboughtLevel,VB_ConsolidationLevel,StrongBuySellAlerts,MediumWeakBuySellAlerts,CautionAlerts,AlertBar,SendTimeInfoAsTimeLocal,PopupAlerts,eMailAlerts,PushNotificationAlerts,SoundAlerts,SoundAlertFileLong,SoundAlertFileShort,SoundAlertFileCautionAlert,Level2,BuyArrowColor,SellArrowColor,StrongBuyArrowCautionColor,StrongSellArrowCautionColor,WeakUpColor,StrongUpColor,WeakDownColor,StrongDownColor,ConsolidationColor,StrongBuyColor,MediumBuyColor,WeakBuyColor,StrongSellColor,MediumSellColor,WeakSellColor,SendTimeInfoAsTimeLocal,Show_TrendVisuals,Show_SignalArrows,SHIFT_Sideway,SHIFT_Up_Down,TrendArrowFontSize,TrendSignalsFontSize,TrendPriceFontSize,TypeFace,UseStochInsteadOfRsi,stochKPeriod,stochDPeriod,stochSlowing,stochMethod,stochPrice,RsiTradeSignalCrossAlerts,RsiTradeSignalCrossMaFilter,filterMaPeriod,filterMaShift,filterMaMethod,filterMaPrice,CustomAlertSoundFileLong,CustomAlertSoundFileShort,4,a);     
   




double  iCustom(
   string       symbol,           // symbol
   int          timeframe,        // timeframe
   string       name,             // path/name of the custom indicator compiled program
   ...                            // custom indicator input parameters (if necessary)
   int          mode,             // line index
   int          shift             // shift
   );



I should have everything according to the syntax

 
Comandantf: Hi all, I was implementing in a code an external/custom indicator, with related external inputs, but the icustom gives me error saying they are wrong. ICustom - wrong parameters count. I should have everything according to the syntax.

Since you did not supply the source code of the custom indicator, or at lease the information about its inputs, it is obviously impossible for us to say if your parameter count is correct or not.

You can also skip any parameters at the end that have a default value or have no use when used from within an EA.

That being said, that Indicator sure does have a lot of parameters. If you have the source code for it, try to clean it or make a version specific for your EA with less bloat, or your back-testing will be very slow.

 
TDI_INDI,                  // 1
RSI_Period,                // 2
⋮
filterMaShift,             // 64
filterMaMethod,
filterMaPrice,
CustomAlertSoundFileLong,
CustomAlertSoundFileShort, // 68
4,
a);
  1. Limit is 63 for iCustom
              Does anyone know if there is a limit on number of inputs allowed in EA? - MQL5 programming forum (2020)

  2. If you need to change some inputs past the 63 rd, and you don't have the source, there is nothing that can be done.

  3. The important parameters should be first and things like color and styles last, since defaulting them changes nothing.
  4. Or, simplify your indicator, or split it into multiple ones.
  5. Or, merge multiple parameters into one string.
              How to get around max number parameters in iCustom ? - General - MQL5 programming forum (2021.02.18)
  6. Or put values into a CSV file and read them.