Max external parameters for iCustom?

 

I'm coding an indicator that has a lot of external parameters (over 60 at present), and I'm having trouble using the iCustom function to call it from an EA. Is there a limit to the number of parameters you can pass using iCustom? (This is probably a question for the MQL programmers).


I thought about using an .ini file to save the parameters that don't need changing very much, but the division of \experts\files and \tester\files folders means that I'd have to have a copy of the file in each of the folders, not to mention I have to write a complex routine to process the file. I tried the WinAPI methods detailed in the article, but I can't get it to work.

 
I just answered my own question. The magic number is 59. You can't pass more than 59 parameters in an iCustom() function. Which means that your indicator can have no more than 59 external parameters.
 

FB

> I'm coding an indicator that has a lot of external parameters

Cant find any reference to any limit - but if you are going with the defaults, you dont need to pass any in the EA, just the buffer to read and the Shift.

If different pairs/timeframes need different sets of values, just 'Save As' another version of the indi?

If you want to use different versions of the indi under different circumstances, you can optionally call a particular version by name?

FWIW

-BB-

 
fuzzbomb wrote >>

I'm coding an indicator that has a lot of external parameters (over 60 at present), and I'm having trouble using the iCustom function to call it from an EA. Is there a limit to the number of parameters you can pass using iCustom? (This is probably a question for the MQL programmers).

I thought about using an .ini file to save the parameters that don't need changing very much, but the division of \experts\files and \tester\files folders means that I'd have to have a copy of the file in each of the folders, not to mention I have to write a complex routine to process the file. I tried the WinAPI methods detailed in the article, but I can't get it to work.

from mql4 reference

Function is a named part of a program that can be called from other parts of the program so many times as it is necessary. It consists of type definition for the value to be returned, name, formal parameters, and a composite operator (block) of actions to be performed. Amount of passed parameters is limited and cannot exceed 64.

I think it refers to iCustom too, plus icustom has standard parameters you need to use. So for indicator it makes something like 59? I wonder if you can do trick and skip some of them from the end of list. If you do not list some indicator params icustom applies standard values from extern definitions of indicator...

 

FB

> If you do not list some indicator params icustom applies standard values from extern definitions of indicator

If you only list three out of the 60, it applies just... the last three IIRC..

Maybe Phy or CB will drop by and confirm!

-BB-

Reason: