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
declare a variable globally and initialize it at declaration, e.g. int kk=0;
then in OnTick() unprint and change value, e.g. Print("kk=",kk); ++kk;
then change TF -- and see the result.
it's clear that the global variable will retain its value even if the TF is changed - but nothing like that happens in the tester.
it is clear that the global variable will retain its value even if the TF is changed - but nothing like that happens in the tester.
Now you have found the answer to the cause of the difference in the results.
When optimizing, parameters are re-selected, i.e. the Expert Advisor is restarted with different settings.
Now you've found the answer to the difference in results.
Do you think that the global EA variable retains its value from past optimiser runs and is carried over to the next ones?
check it, it's easier to check than guess.
Renat above wrote that the optimizer works "like clockwork" and that the reason is in the code -- he recommended several times to do an unpriming -- I assume that no one has done it.
have you checked it yourself? any clear examples of when a single run will work differently than as part of optimization?
for example, i remember, removing a handle in the tester didn't work before, it caused memory overflow and terminal crash along with the system. maybe this problem has been solved already but there are still some pitfalls with creation and removal of indicator handles and there are differences in optimizer and single indicator runs. as i know developers worked very hard to speed up and minimize memory consumption wherever possible.
have you checked it yourself? are there clear examples in which cases a single run will work differently than as part of the optimisation?
in this case it is not a single run.
Check initialization of globally declared variables.
If initialization is not in OnInit(), but in declaration and if their values are changed in the code.
A simple example:
Although.... The compiler doesn't generate the warning for some reason if you put the declaration into the global scope (((
I was expecting something different...
A simple example:
Although.... The compiler doesn't generate the warning for some reason if you put the declaration into the global scope (((
I was expecting something different.
The fifth page was going on, but there was still no mql5 code... There also remains a mystery shrouded in darkness regarding testing: symbol(s), timeframe(s), testing settings.
Well, one more question before I start priming.
For example, I have recorded the results:
optimizer - buy;sell;sell;buy;buy;sell
tester - buy;sell;sell;buy;buy;sell;buy;buy;sell
How can the data on these"extra" deals help to understand what ceiling they came from? Perhaps we should write the prices of previous bars as well, or what else?
The fifth page was going on, but the mql5 code still wasn't there... There also remains a mystery shrouded in darkness regarding testing: symbol(s), timeframe(s), testing settings.
Welcome back from holiday ))))
You can see everything here.
A simple example:
Although.... The compiler doesn't generate the warning for some reason if you put the declaration into the global scope (((
I was expecting something different...
If 'x' is of the double type, the given examples are fundamentally wrong and the 'y' state is undefined in both cases
that is, it is possible that somewhere in the depths of neural networks one may get either special double values - inf-types, nan-types or similar to eps-values