Lot calculation by Vince - page 4

 
MaxZ:
Shit... Here's how it works.

I.e., we run the test for the first time on the history - then fill in the value of variable D = largest loss on a trade in the external variables via the strategy tester tab "Expert Advisor Properties" (see the screenshot above), then run the test again and look at the optimal f value in the "Journal" tab via its calculation in the de-init function.
 
Vinin:

Variable D is the value of the largest loss trade during the last N trades


Yes. We see its value in the "Report" tab of the tester, after the first test, then we enter its value into external variables and run the owl test again on the same period and calculate f here in de-init.

Before the first test it can have any value - it doesn't matter...

 
MaxZ:

That's what I'm trying to tell you:


Variable D doesn't need to be involved there... You already assign its value to it after the first owl history test in external variables.
 
And the calculation is for the last N transactions
 
Vinin:
And calculation is performed for last N trades


Yes, this value is also taken from the first test and then entered into the formula in the de-intent before the second test to calculate the optimal f (do not forget to recompile the EA) and enter parameter D in the external variable. Other settings and parameters of the Expert Advisor should be the same as for the first test.

 
Roman.:

Variable D does not need to be involved there... You already assign its value to it after the first owl history test in external variables.
If variable D is involved there, then we will only run the test once, not twice. Or am I wrong about something?
 
Roman.:


Yes, this value is also taken from the first test and then entered into the formula in the de-intent before the second test to calculate the optimal f (remember to recompile the EA) and enter the D parameter in the external variable. Other settings and parameters of the Expert Advisor should be the same as for the first test.


One more parameter is needed - Number of trades analysed. You don't want to do any fitting. And this is the depth of the analysed history. Then the first parameter becomes an estimate
 
MaxZ:
Thus We will conduct the test only once, and not twice. Or am I wrong about something?


Let's do it again.

For the first time, we test the history up to the present time with optimized values of external variables, at that the value of D is not taken into account (doesn't matter).

Then we open the Report tab of the Strategy Tester and look at the value of the largest loss on a trade, enter this value of the largest loss into the D external variable of the Expert Advisor through the tab "Expert Advisor Properties". We also open the code of the Expert Advisor in the MetaEditor and prescribe here in the code the value 1/N (where N = total number of trades), if we write 1/503 in this formula, it will not be considered correctly, so we divide it with a calculator and enter the obtained value into the formula. Next, compile the Expert Advisor, look at the tab for external variables (their values must be the same as in the first test), check the value of variable D. Close it. Start testing the owl for the second time... and now, in the "Journal" tab of the strategy tester, see the value of the optimal f. Then we calculate the volumes of traded lots (see the book on page 31), put the owl with these calculated volumes of lots into the demo account.

G=MathPow (TWR_Rez, 0.001988); // 1/503 сделки по данной торговой системе, как в книжке: в степени 1/N 
 
Vinin:

You need another parameter - Number of trades analysed. You don't want to do any fitting. And this is the depth of the analysed history. Then the first parameter becomes an estimate.

Victor, the thing is that I've been testing the owl since 2002, since the beginning of entries (fulfilling conditions for opening deals according to my trading criteria and indicators) till now... That's why the number of deals is not important here. Some of my systems have one value - 500 deals, for example, others have 1050, so it's not a matter of principle. I am testing from the beginning of the history to the present time, from 08.2010 to 08.2011 - forward test - it is also considered, i.e. the maximal depth of history. If you say adjusting, but you can somewhat increase the value of maximal loss, i.e. if it is for 550 trades from 09. 2002 and has a value of -600$ after the first test, because nobody is preventing to make its value -800$ (-200$ is a tolerance...) - to enter its value in external variables and use these values of maximal loss to calculate an optimal f for future trade... I'm working on it...
 
Roman.:

Either I got it wrong again, or the results of running the EA in the tester the first and second time are identical. There is only one "but": the second time the Expert Advisor still calculates the optimal parameter f...
Reason: