What is not intuitive is that arrays of parameters and names return different sizes, because there is no null parameter in names, which represents the name of the Expert Advisor.
Also I would like to know the real types of parameters, now "string" is returned everywhere. I don't know how to provide this - the head-on way: analyse the contents of the string and its reducibility to a floating-point number or integer, but if the parameter stores "0", its type cannot be identified.
What is non-intuitive is that the parameter and name arrays return different sizes because the names lack a null parameter representing the name of the Expert Advisor.
Yes, it is not very nice. Perhaps we should have made a fake null element for Names[].
Also I would like to know the real types of parameters, right now "string" is returned everywhere. I don't know how to provide this - the way to do it head-on: analyse the contents of the string and its reducibility to a floating point number or integer, but if the parameter stores "0", you can't identify its type.
I considered it unnecessary in the library, because there are still custom ENUMs. Moreover, I didn't see a task where it might be necessary.
I was making my own auto-optimiser. It was not useful there.
Yes, it's not very nice. Perhaps you should have made a fake null element for Names[].
I considered it unnecessary in the library, because there are also custom ENUMs. Moreover, I didn't see a task where it could be necessary.
I was making my own auto-optimiser. It was not useful there.
ParameterGetRange/ParameterSetRange functions are defined only for long and double types, so the parameter loop requires to analyse and change settings only for numbers.
ParameterGetRange/ParameterSetRange functions are defined only for long and double types, respectively, the loop on parameters requires to analyse and change settings only for numbers.
Hi, I can't figure out how to open on expert with authorised trade
this code opens normally with the inputs I pass.
Params[0].string_value = "Experts\\Shared Projects\\luipaulo89\\experts\\PullbackEA_v2.ex5";
// The first input parameter of the Expert Advisor
Params[1].type = TYPE_STRING;
Params[1].string_value = "Hello World!";
Params[2].type = TYPE_INT;
Params[2].integer_value = 0;
// On a new chart, run the Expert Advisorif (inpFirst==1) EXPERT::Run(ChartOpen(_Symbol, _Period), Params);
If I use this code
Params[0].string_value = "Experts\\Shared Projects\\luipaulo89\\experts\\PullbackEA_v2.ex5";
Params[0].string_value += "\nexpertmode=5";
// The first input parameter of the Expert Advisor
Params[1].type = TYPE_STRING;
Params[1].string_value = "Hello World!";
Params[2].type = TYPE_INT;
Params[2].integer_value = 0;
// On a new chart, run the Expert Advisorif (inpFirst==1) EXPERT::Run(ChartOpen(_Symbol, _Period), Params);
it opens with allowed trade but does not pass parameters.
The task is to open the same Expert Advisor on a new chart.
input group "EA Settings"inputint inpFirst = 1;//first instance;
so that only the first Expert Advisor can open new ones, I pass 0 to new ones, but unfortunately in the second variant (when trading is allowed) no parameters are passed (or passed incorrectly).
input group "EA Settings"inputint inpFirst = 1;//first instance;voidOnInit() {}
Example1.
#include <fxsaber\Expert.mqh>
voidOnStart()
{
MqlParam Params[3];
// Pathway to Counsellor
Params[0].string_value = "Experts\\Test6.ex5";
Params[0].string_value += "\nexpertmode=5";
// input group "EA Settings"
Params[1].type = TYPE_STRING;
Params[1].string_value = NULL;
// input int inpFirst
Params[2].type = TYPE_INT;
Params[2].integer_value = 123;
EXPERT::Run(ChartOpen(_Symbol, PERIOD_CURRENT), Params); // Will not be able to correctly run the Expert Advisor on its own chart
}
Example2.
#include <fxsaber\Expert.mqh>
voidOnStart()
{
MqlParam Params[3];
// Pathway to Counsellor
Params[0].string_value = "Experts\\Test6.ex5";
Params[0].string_value += "\nexpertmode=5";
// input group "EA Settings"
Params[1].type = TYPE_STRING;
Params[1].string_value = NULL;
EXPERT::AddInputName(Params[1], " "); // Probl.// input int inpFirst
Params[2].type = TYPE_INT;
Params[2].integer_value = 123;
EXPERT::AddInputName(Params[2], "inpFirst");
EXPERT::Run(0, Params); // Will be able to correctly run the Expert Advisor on its own chart.
}
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.
What is not intuitive is that arrays of parameters and names return different sizes, because there is no null parameter in names, which represents the name of the Expert Advisor.
Also I would like to know the real types of parameters, now "string" is returned everywhere. I don't know how to provide this - the head-on way: analyse the contents of the string and its reducibility to a floating-point number or integer, but if the parameter stores "0", its type cannot be identified.
What is non-intuitive is that the parameter and name arrays return different sizes because the names lack a null parameter representing the name of the Expert Advisor.
Yes, it is not very nice. Perhaps we should have made a fake null element for Names[].
Also I would like to know the real types of parameters, right now "string" is returned everywhere. I don't know how to provide this - the way to do it head-on: analyse the contents of the string and its reducibility to a floating point number or integer, but if the parameter stores "0", you can't identify its type.
I considered it unnecessary in the library, because there are still custom ENUMs. Moreover, I didn't see a task where it might be necessary.
I was making my own auto-optimiser. It was not useful there.
Yes, it's not very nice. Perhaps you should have made a fake null element for Names[].
I considered it unnecessary in the library, because there are also custom ENUMs. Moreover, I didn't see a task where it could be necessary.
I was making my own auto-optimiser. It was not useful there.
ParameterGetRange/ParameterSetRange functions are defined only for long and double types, so the parameter loop requires to analyse and change settings only for numbers.
ParameterGetRange/ParameterSetRange functions are defined only for long and double types, respectively, the loop on parameters requires to analyse and change settings only for numbers.
Integer types are bool, enums.
Integer types are bool, enums.
This is normal. It is not normal that now everything is represented by strings and it is impossible to sift out real strings.
That's normal. What's not normal is that everything is now represented by strings and you can't sift out the actual strings.
The parameters to be optimised are numbers in advance. So there are definitely no strings among them. So you can use it as a filter.
Hi, I can't figure out how to open on expert with authorised trade
this code opens normally with the inputs I pass.
If I use this code
it opens with allowed trade but does not pass parameters.
The task is to open the same Expert Advisor on a new chart.
so that only the first Expert Advisor can open new ones, I pass 0 to new ones, but unfortunately in the second variant (when trading is allowed) no parameters are passed (or passed incorrectly).
in the tpl file the header is created perfectly, but for some reason it does not pass the parameter
expected to be inpFirst=0
Update the library.
Test Expert Advisor.
Example1.
Example2.