The optimisation has gone through, we have written down all the parameters to be searched with ranges of values.
And then we run a single test, read the parameter list, and display it: parameter = value. In this case we don't know the value, because we can't refer to the input variable by name.
You make the input parameter bool Optim. In OnInit, you return INIT_FAILED if Optim == true. At the same time in OnTesterPass through FrameInputs and ParameterGetRange (or in the destructor of the global class object) you write the actual SET of Optimization.
Then you put Optim = false. And take one more parameter sinput int Range, set it through ParameterSetRange to change from zero to one. Read the SET-file in OnTesterInit and set values of all the parameters from the file in ParameterSetRange. When Range == 0 you return INIT_FAILED in OnInit.
That's all! Instead of single Optimization you have imaginary Optimization, which is also faster than single Optimization.... Plus read/write input parameters.
off-topic question but I will ask you if it is possible to supplement the MQL5 handbook with additional examples of algorithm implementation more and clearer
Make the input parameter bool Optim. In OnInit you return INIT_FAILED if Optim == true. At the same time in OnTesterPass through FrameInputs and ParameterGetRange (or in destructor of global class object) you write actually SET-file Optimization.
Then you put Optim = false. And take one more parameter sinput int Range, set it through ParameterSetRange to change from zero to one. Read the SET-file in OnTesterInit and set values of all the parameters from the file in ParameterSetRange. When Range == 0 you return INIT_FAILED in OnInit.
That's all! Instead of single Optimization you have imaginary Optimization, which is also faster than single Optimization.... Plus read/write input parameters.
The difference is huge. When g(f) is called, the compiler has no idea what type f is, because only template is prescribed. If you overload the template, there is no problem
typedefvoid (*fn)();
template<typename T>
void g( T Value ) { Print(typename(Value)); }
void f() {}
void g( fn Value ) { Print(typename(Value)); }voidOnStart()
{
g( f ); // void(*fn)()
}
The difference is huge. When g(f) is called, the compiler has no idea what type f is, because only the template is prescribed. If you overload the template, there is no problem
If there is a huge difference, then why does C++ compile well with both variants?
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.
How does this help?
The optimisation has gone through, we have written down all the parameters to be searched with ranges of values.
And then we run a single test, read the parameter list, and display it: parameter = value. In this case we don't know the value, because we can't refer to the input variable by name.
You make the input parameter bool Optim. In OnInit, you return INIT_FAILED if Optim == true. At the same time in OnTesterPass through FrameInputs and ParameterGetRange (or in the destructor of the global class object) you write the actual SET of Optimization.
Then you put Optim = false. And take one more parameter sinput int Range, set it through ParameterSetRange to change from zero to one. Read the SET-file in OnTesterInit and set values of all the parameters from the file in ParameterSetRange. When Range == 0 you return INIT_FAILED in OnInit.
That's all! Instead of single Optimization you have imaginary Optimization, which is also faster than single Optimization.... Plus read/write input parameters.
off-topic question but I will ask you if it is possible to supplement the MQL5 handbook with additional examples of algorithm implementation more and clearer
Make the input parameter bool Optim. In OnInit you return INIT_FAILED if Optim == true. At the same time in OnTesterPass through FrameInputs and ParameterGetRange (or in destructor of global class object) you write actually SET-file Optimization.
Then you put Optim = false. And take one more parameter sinput int Range, set it through ParameterSetRange to change from zero to one. Read the SET-file in OnTesterInit and set values of all the parameters from the file in ParameterSetRange. When Range == 0 you return INIT_FAILED in OnInit.
That's all! Instead of single Optimization you have imaginary Optimization, which is also faster than single Optimization.... Plus read/write input parameters.
Thanks for the detailed algorithm.
'TesterBenchmark_Example.mq5' TesterBenchmark_Example.mq5 1 1 'TesterBenchmark.mqh' TesterBenchmark.mqh 1 1 0 error(s), 0 warning(s), compile time: 3113 msec 1 1Compile time at 1648
'TesterBenchmark_Example.mq5' TesterBenchmark_Example.mq5 1 1 'TesterBenchmark.mqh' TesterBenchmark.mqh 1 1 0 error(s), 0 warning(s), compile time: 219 msec 1 1Something's been tweaked!
Compilation error
And if you replace line (*) with
then it's fine. What's the difference?It looks likehttps://www.mql5.com/ru/forum/1111/page1977#comment_5595772, but has a different error code
Error during compilation
Otherwise:
It's fine. What difference does it make?Error during compilation
but this way:
normally. What's the difference?The difference is huge. When g(f) is called, the compiler has no idea what type f is, because only template is prescribed. If you overload the template, there is no problem
Compile time at 1643.
Compile time at 1648
That's a cool tweak!
Mine is the same as it was, compilation is not faster!
I still have it, compilation is not accelerated
Perhaps not using what used to slow down in TesterBenchmark.mqh
The difference is huge. When g(f) is called, the compiler has no idea what type f is, because only the template is prescribed. If you overload the template, there is no problem