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
Is there a forced termination of the OnTester() function
or why the history of transactions before the custom function exists and returns zero afterwards :
what functions are not working in the tester ?
how can the tester (during optimisation) signal to the outside that something is wrong (print alerts, nothing works) ?
Apparently, everyone is asleep today.
Have you looked at the agent logs, maybe everything is there?
As far as I know, printers are not displayed in the main tester log only during optimization (in normal mode everything is OK).
OnTester() as I understand it is not possible to forcibly exit. And what for? It simply calculates a certain test result (moreover, it is essentially used only for optimization)?
The OnTester() function is a Tester event handler that is automatically generated at the end of the Expert Advisor's historical testing on a given date interval. The function must be defined with type double, it has no parameters:
doubleOnTester();
The function is called immediately before OnDeinit() and has the return type double. The OnTester() function can be used only in experts during testing. Its main purpose is to calculate some value to be used as the Custom max criterion in the genetic optimization of input parameters.
PS
> why does the history of transactions before a custom function, but after that it shows zero...
Perhaps this is a question for the developers.
As far as I understand, OnTester must return the number of trades (if there are any), while Custom_func() is understood as a custom function?
Dedicated to the developers ...
You guys at least would have warned if you give an opportunity that before in principle was not possible.
I wasted twenty-four hours trying to catch this bug.
Don't tell me that it's okay, of course I know that, but I've wasted 24 hours just because I'm used to the fact that with this
I'm used to getting the compiler to give me an error.
Is there a forced termination of the OnTester() function
or why the history of transactions before the custom function exists and returns zero afterwards :
what functions are not working in the tester ?
how to signal from tester (during optimisation) to the outside that something is wrong (prints alerts nothing works) ?
Thank you for your message. Your application has been received - we are dealing with it.
How do I calculate the maximum allowable lot by margin to open a new position? In MQL4 it was done as follows:
MaxLot=AccountFreeMargin()/MarketInfo(Symbol(),MODE_MARGINREQUIRED);
How do I calculate the maximum allowable lot by margin to open a new position? In MQL4 it was done like this:
Approximately like this:
This code not only calculates the maximum volume, but also fits it exactly within the limits of the symbol settings.It goes something like this:
This code not only calculates the maximum volume, but also fits it exactly within the limits of the character setting.Thank you! I don't have OrderCalcMargin() in my help :)
So what's the right way in the end? Is it "==" or is it "="?
Either way.
if(a==0){expression} means if a is 0 then it's true, so we execute {expression}.
if(a=0){expression} equals if(a){a=0;expression} if a is true, {a=0;expression}.
Have you looked at the agent logs, maybe everything is there?
As far as I know, printers are not displayed in the main tester log only during optimization (in normal mode everything is OK).
OnTester() as I understand it is not possible to forcibly exit. And what for, it just calculates a certain test result (which in fact is used only for optimization)?
PS
> Why does the history of transactions before a custom function exist and give out zero afterwards...
Perhaps this is a problem for the developers.
As far as I understand, the OnTester should return the number of deals (if there are any), while the custom function is Custom_func()?
That's the problem is that in the optimization itself the program does not work like in other situations (that's why I need to send message from under OnTester).
For this purpose I have created analog of print (function that creates a file for the sake of printing a string passed to the function as a parameter).
Thus, I managed to catch the incorrect execution of some functions in OnTester.