Can someone check me, I'm getting Error<4002> [WRONG_INTERNAL_PARAMETER] with iCustom

 

Here's what I print out when an iCustom() fails:

ChartID<133608959982095523> symbol<USDJPY> TF<PERIOD_M12>: [Slope of MA Signals MJM.mq5 [OnInit] LINE 272 - Indy >>Slope(1) of iMA(7,CLOSE)<< failed! Error<4002> [WRONG_INTERNAL_PARAMETER] sSymbol<USDJPY> eChrt_TF<PERIOD_M12> Ii_MA_Prd<7>

Here is the call to iCustom:

        iIndy_Hndl              = iCustom( IsSymb,
                                           IeTF,
                                           sSlopeOfMALocn,          // contains name of custom indicator
                                           IsSymb,                  // the input variables in the custom indicator (value of sSlopeOfMALocn) start with this one
                                           IeTF,
                                           Ie_Applied_Price,
                                           IiStrtAtBarsBack,
                                           IdtStrtAtDT,
                                           Ii_MA_Prd,
                                           Ii_MA_Shift,
                                           Ie_MA_Mthd,
                                           Ie_MA_Applied_Price,
                                           IeIndyBuffer,
                                           IiSlpePrd,
                                           IiSlpeApplPrce,
                                           IiSlpeCLR,
                                           IiSlpeWdth,
                                           Ib_DoSlpeOfSlpe,
                                           IiSlpeOSlpePrd,
                                           IiSlpeOSlpeApplPrce,
                                           IiSlpeOSlpeCLR,
                                           IiSlpeOSlpeWdth,
                                           Ib_Show_SlpeLine,
                                           Ib_Show_SlpeOSlpeLine,
                                           Ib_Show_NetSlpeLine,
                                           IiNetSlpeCLR,
                                           IiNetSlpeWdth,
                                           Ib_Show_SumONetSlpeLine,
                                           IiSumONetSlpePrd,
                                           IiSumONetSlpeCLR,
                                           IiSumONetSlpeWdth
                                           );


And here's the input parameters list in the custom indicator (sSlopeOfMALocn):

input group                "Where and when: these default to current chart"                              
input string               IsSymb                  = "USDJPY";                     // Select a currency pair                          
input ENUM_TIMEFRAMES      IeTF                    = PERIOD_CURRENT;               // Select a chart timeframe                                 
input ENUM_APPLIED_PRICE   Ie_Applied_Price        = PRICE_CLOSE;                  // Type of price shown in data window (OHLC only)            
input int                  IiStrtAtBarsBack        = 500;                          // If 0: "now" mode, no history; if <> 0, start n bars back                           
                              
input group                " "                                                         
input group                "In case you don't want all available history"                              
//input datetime           IdtStrtAtDT             = D'2024.05.17 08:00:00';       // 1970.01.01 00:00:00 = "now" mode, no history, else start date                              
input datetime             IdtStrtAtDT             = 0;                            // 1970.01.01 00:00:00 = "now" mode, no history, else start date                              

input group                " "                           
input group                "MA calculation parameters"                           
input group                "---------------------------"                           
input int                  Ii_MA_Prd               = 7;                            //   MA calcuation Period
input int                  Ii_MA_Shift             = 0;                            //   MA Chart shift
input ENUM_MA_METHOD       Ie_MA_Mthd              = MODE_LWMA;                    // MA calculation method
input ENUM_APPLIED_PRICE   Ie_MA_Applied_Price     = PRICE_CLOSE;                  // Price used for MA calculation         

input group                " "
input group                "Slope calculation parameters"
input group                "---------------------------"                           
input ENUM_INDY_RO_BUFFER  IeIndyBuffer            = 0;                            // Indy data buffer to read for Slope calculation
input int                  IiSlpePrd               = 1;                            // Slope period (# bars back)
input ENUM_APPLIED_PRICE   IiSlpeApplPrce          = PRICE_CLOSE;                  // Price used for Slope calculation (if applicable)
input color                IiSlpeCLR               = clrAqua;                      // Color of Slope line
input int                  IiSlpeWdth              = 2;                            // Size of Slope line

input group                " "
input group                "Slope of Slope parameters"
input bool                 Ib_DoSlpeOfSlpe         = true;                         // true = calculate slope of the slope; false = simple slope only
input int                  IiSlpeOSlpePrd          = 2;                            // Slope period (# bars back)
input ENUM_APPLIED_PRICE   IiSlpeOSlpeApplPrce     = PRICE_CLOSE;                  // Price used for Slope calculation (if applicable)
input color                IiSlpeOSlpeCLR          = clrMagenta;                   // Color of Slope line
input int                  IiSlpeOSlpeWdth         = 2;                            // Size of Slope line
input group                " "                           
input group                "Chart Display parameters"                           
input bool                 Ib_Show_SlpeLine        = true;                         // Plot slope of MA line on chart
input bool                 Ib_Show_SlpeOSlpeLine   = true;                         // Plot slope of slope of MA on chart
input bool                 Ib_Show_NetSlpeLine     = true;                         // Plot net of slope + slope of MA on chart
input color                IiNetSlpeCLR            = clrWhite;                     // Color of Net Slope line
input int                  IiNetSlpeWdth           = 2;                            // Size of Net Slope line
input bool                 Ib_Show_SumONetSlpeLine = true;                         // Plot the sum of last n periods of Net Slope
input int                  IiSumONetSlpePrd        = 3;                            // # of periods to sum (0 = none, 1 = current net slope)
input color                IiSumONetSlpeCLR        = clrOrange;                    // Color of Slope line
input int                  IiSumONetSlpeWdth       = 2;                            // Size of Slope line

Can you see a problem? I can't.

Or is there some hidden "internal parameter" I'm missing somewhere?

 
You can't skip "group" parameter, you need to pass a "".
 
Alain Verleyen #:
You can't skip "group" parameter, you need to pass a "".
LMAO! I kid you not, I just now thought that might have something to do with it. I was going to look for more info and thought I'd check if anyone had responded here yet. Thanks Alain! Yet another "undocumented feature"? At least now I'll be able to control iCustom-called indicators. I was forced to let them rest on their defaults to get them to work at all, lol.
 

Hi

You might also have to check if the name of the symbol (IsSymb) is correct with the name used by your broker. But if this is correct you can try this on mql5 (Also if this is mql4 you need to add buffer and candle at the end of icustom):

string ss = "";
iIndy_Hndl              = iCustom(           IsSymb,
                                           IeTF,
                                           sSlopeOfMALocn,          // contains name of custom indicator
                                           ss,
                                             IsSymb,                  // the input variables in the custom indicator (value of sSlopeOfMALocn) start with this one
                                           IeTF,
                                           Ie_Applied_Price,
                                           IiStrtAtBarsBack,
                                           ss,
                                        IdtStrtAtDT,
                                           ss,
                                           ss,
                                           ss,
                                           Ii_MA_Prd,
                                           Ii_MA_Shift,
                                           Ie_MA_Mthd, 
                                           Ie_MA_Applied_Price,
                                           ss,
                                           ss,
                                           ss,
                                           IeIndyBuffer,
                                           IiSlpePrd,
                                           IiSlpeApplPrce,
                                           IiSlpeCLR,
                                           IiSlpeWdth,
                                           ss,
                                           ss,
                                           Ib_DoSlpeOfSlpe,
                                           IiSlpeOSlpePrd,
                                           IiSlpeOSlpeApplPrce,
                                           IiSlpeOSlpeCLR,
                                           ss,
                                           ss,
                                           IiSlpeOSlpeWdth,
                                           Ib_Show_SlpeLine,
                                           Ib_Show_SlpeOSlpeLine,
                                           Ib_Show_NetSlpeLine,
                                           IiNetSlpeCLR,
                                           IiNetSlpeWdth,
                                           Ib_Show_SumONetSlpeLine,
                                           IiSumONetSlpePrd,
                                           IiSumONetSlpeCLR,
                                           IiSumONetSlpeWdth
                                           );

Best Regards