What on earth is going on? - page 4

 
SeriousRacoon:
And try disabling the current logic and replacing it with an ordinary wizard. You'll immediately see where the cat's gone wrong, in the logic or the execution.

good advice.... We should not get to the point where we think that the optimization is nothing but separate instances of single runs, at least, that is what users would like and what the developers wanted.

This means that no matter how complex the algorithm of the Expert Advisor is, the result of a single run should be identical to the one obtained in a group of runs during optimization.

I would print (as Renat advises) upon completion of each run during optimization the history of deals into a file containing parameters (to facilitate searching among a pile of created files) and do the same for a single run, in this way it will be possible to find the difference of results after optimization and a single run. it seems to be the only way to get to the truth.

however, i am very curious about what, what nuance, may cause different results in optimization and single run, because logic suggests that this is impossible in principle, provided that a single run is identical to the one in the optimization batch run.

 
Алексей Тарабанов:

" almost all data is initialised in a loop".

Guys, you can't initialise in a loop. You have to read in the loop.

I showed you in which cases it is not only possible, but necessary and there is no other way.

 

@Andrey Dik, I'm wondering exactly how to bolt print to file(s). It seems that the file should be written as you go along. And what exactly should be written there? Prices are not informative. You need to write some information that will help you understand the reason for the discrepancy. What kind of information? Where can we find it? I have no idea yet.

 
Сергей Таболин:

@Andrey Dik, I'm wondering exactly how to bolt print to file(s). It seems that the file should be written as you go along. And what exactly should be written there? Prices - not informative. You need to write some information that will help you understand the reason for the discrepancy. What kind of information? Where can we find it? I have no ideas yet.

In the OnTester() function, create a file called InputName1 + "_" + InputName2 + "_" + InputName3 + "_" + InputName4 + "_" +.... and record the history of all trades (not positions) in it, all the necessary information for analysis, time, price, etc. will be recorded. You can also write in this file something else very interesting for a particular EA, which may be useful for searching for inconsistencies between the optimizer and a single run.

Don't forget to check MQLInfoInteger (MQL_OPTIMIZATION)); to add postfix in file name at single run, so as not to overwrite the same file after optimization.


SZY. If you get two files with different contents, it will not be enough for developers, but will only give you a direction where to dig further, you will need to bring a reproducible problem code. hopefully, the problem is in the EA's code.

 
Andrey Dik:

In the OnTester() function create a file named InputName1 + "_" + InputName2 + "_" + InputName3 + "_" + InputName4 + "_" +.... and record the history of all trades (not positions) in it, all the necessary information for analysis, time, price, etc. will be recorded. You can also write in this file something else very interesting for a particular EA, which may be useful for searching for inconsistencies between the optimizer and a single run.

Don't forget to check MQLInfoInteger (MQL_OPTIMIZATION)); to add postfix in file name at single run, so as not to overwrite the same file after optimization.


SZY. If you get two files with different contents, it will not be enough for developers, but will only give you direction where to dig next, you will need to cite a reproducible code problem. I hope the problem is in the EA code.

Thank you. Will do.

 
Сергей Таболин:

Thank you. I'll be doing that.


 
Сергей Таболин:

Thank you. Will do.

Check initialization of globally declared variables.

If initialization is not in OnInit() but in declaration and if their values are changed in the code.

 
Andrey F. Zelinsky:

Check initialization of globally declared variables.

If initialization is not in OnInit(), but in declaration and if their values are changed in the code.

whether the variables are initialized or not, but the results should coincide in both tester modes (optimization and single run)

 
Andrey Dik:

good advice.... We should not get to the point where we think that the optimization is nothing more than separate instances of single runs, at least that is what users would like and what the developers wanted.

This means that no matter how complex the algorithm of the Expert Advisor is, the result of a single run should be identical to the one obtained in a group of runs during optimization.

I would print (as Renat advises) after completion of each run during optimization the history of deals into a file containing parameters (to facilitate searching among heap of created files) and do the same during a single run, thus it would be possible to find out the difference of results after optimization and a single run.

however, i am very curious about what, what nuance, may cause different results in optimization and single run, because logic suggests that this is impossible in principle, provided that a single run is identical to the one in the optimization batch run.

In general, I agree with you. If owl really doesn't make branches depending on environment (whether it's running in optimizer or in tester), then the only thing we can assume is that in optimization mode some api calls in tester are too optimized for speed, pardon the tautology. Perhaps it depends on the flags in the functions used. A detailed log of transactions and execution results would help, yes.

Haven't come across this personally.

 
Andrey Dik:

whether the variables are initialized or not, but the results should match in both tester modes (optimization and single run)

declare a variable globally and initialize it when declaring, for example, int kk=0;

then in OnTick() unprint and change the value, for example Print("kk=",kk); ++kk;

then change TF or parameters -- and see the result.

Reason: