I have this function stored as library function. It is import in a header file:
double hseGambit(double aPrice, double bPrice, int deal1=0, int deal2=0, int players=-1);
My question is about those 3 int parameters (highlighted in red) set to respective default values. If the EA call the fuction eg:
hseGambit(High,Low, 1, 5, 4);
Will this work well, and also during testing? And will this work well?
I was searching hi and low, cant find anything. I tried and it does seem not to work, for some unbeknowned reasons....
[...] Will this work well, and also during testing? And will this work well?
The MQ4 documentation says that your second example ( hseGambit(High, Low); ) isn't going to compile. The page at https://docs.mql4.com/basis/variables/formal says "MQL4-library functions imported within other modules cannot have parameters initialized by default values"
In other words, you can have functions with optional parameters in a MQH file (which you #include) but not in a EX4 library or DLL (which you #import).
Please enable the necessary setting in your browser, otherwise you will not be able to log in.