-
The language does not have variadic functions. And there is no way to know what or how many parameters an indicator has.
-
Function with variable number of parameters - MQL4 programming forum 2018.01.06
Different Indicators Parameters to iCustom - MQL5 programming forum 2020.04.27
thank you @William Roeder
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I'm not a MQL4 expert but i was trying to develope the following idea.
I would want to creat an EA which could get the number of parameters and buffers(outputs) from a custom indicator, so i can use that information to implement it on the iCustom() function.
This will be use to backtest diferente custom indicators without the need to change the EA code when the custom indicator is different.
It would go something like this:
int parameters = count_parameters();
int outputs = count_outputs();
for(i=0;i<outputs;i++)
value[i] = iCustom(NULL,0,param0, param1....,output[i],0)
The first thing here is how to make count_parameters() and count_outputs() work(if possible...). If this is not possible, I can make this two variables(parameters and outputs), as extern variables, so i can modify them on EA's Properties buttom.
And second, how to build iCustom() function with a variable number of parameters depending ont the "parameters" variable.
I don't even know if this is possible, but it is worth asking.
Thanks in advance!