This situation does not seem to be considered. When the parameter is a group, there is no specific value and the value obtained will be null, so no parameters after the group will be obtained.
The following code shows that everything is handled correctly.
inputbool InRun = true;
input group "label1"inputdouble In2 = 2.0;
#include <fxsaber\Expert.mqh> // https://www.mql5.com/en/code/19003int GetAmountExperts()
{
int Res = 0;
for (long Chart = ChartFirst(); Chart != -1; Chart = ChartNext(Chart))
Res += (ChartGetString(Chart, CHART_EXPERT_NAME) != "");
return(Res);
}
voidOnInit()
{
if (InRun)
{
MqlParam Params[];
string Names[];
constint Size = EXPERT::Parameters(0, Params, Names) - 1;
ArrayPrint(Params);
ArrayPrint(Names);
int nameSize = ArraySize(Names);
for (int i = nameSize-1; i >= 0; i--) {
if (Names[i] == "InRun")
Params[i+1].string_value = "false";
EXPERT::AddInputName(Params[i + 1], Names[i]);
}
ArrayPrint(Params);
ArrayPrint(Names);
//Params[Size].string_value = "7";
EXPERT::Run(ChartOpen(_Symbol, _Period), Params);
return;
}
Print("In2 = ", In2);
}
The GetAmountExperts function runs for an unknown reason for a very long time with no result. I changed the code a bit - please run it again. You should not assign the value 7 to the In2 parameter (you will see that there is 0, not 2).
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If there is a problem, please give ready mq5 files for playback.
This situation does not seem to be considered. When the parameter is a group, there is no specific value and the value obtained will be null, so no parameters after the group will be obtained.
The following code shows that everything is handled correctly.
Result.
Expert Advisor launched through Expert.mqh.
The GetAmountExperts function runs for an unknown reason for a very long time with no result. I changed the code a bit - please run it again. You should not assign the value 7 to the In2 parameter (you will see that there is 0, not 2).
I've changed the code a bit - please run it again.
This is an exemplary bug report: ran the concise code, which immediately showed the bug.
Made the correction, thanks.
This is an exemplary bug report: ran concise code that immediately showed a bug.
I've made the correction, thank you.
If the script is loaded, it looks like the input parameters cannot be changed.
If the script is loaded, it looks like the input parameters cannot be changed.
Such is the architecture of MT5 that you cannot set input parameter values for scripts and you cannot read them.
The library has an eloquent name.
Such is the architecture of MT5 that you can't set input parameter values for scripts and you can't read them.
The library has an eloquent name.
Forum on trading, automated trading systems and testing trading strategies
Libraries: Expert
fxsaber, 2018.11.16 09:19 AM.
An example of another application of the library