Lot calculation by Vince - page 6

 
Vinin:

I'm only talking about the number of trades to be analyzed. Real or virtual.


Ahh, now I get it, maybe that's not the right approach, as the sample should be representative, i.e. the more the better...

Everyone, of course, has his own criteria - for someone 200 is enough, and for someone 500 is not enough...

I keep digging further for an optimal solution in search of the optimal (excuse me for being tofthologic) f by R.Vince using his method of geometric mean.

 
MaxZ:
That's not exactly the advice I was giving. It's more your approach already. The important thing is that it also turns out to be correct.


Well, how - because that's exactly what I did, only directly in relation to TWR - but not to its geometric mean G.

"For if the root of degree K of number_1 is greater than the root of the same degree K of number_2, then number_1 is greater than number_2! :))))))"

TWR is "relative finite capital" (Terminal Wealth Relative) ,

 TWR = MathPow(TWR*(1+f*(-Mas_Outcome_of_transactions[orderIndex]/(D))),0.33); // TWR - это произведение всех HPR    
 
Roman.:


I do all the calculations in the teter by opening prices, trades from 2002 to date 2011 - 503, the most retracted trade = -628.

The results are above. I am now testing on other EA variants.

Here is the text of the approach to solving this problem from the original source - p. 31.

We have seen that the best trading system is the system with the highest geometric mean. To calculate the geometric mean we need to know f. So, let's describe our actions step by step.

1. Take the history of transactions in the given market system.

2. Find the optimal f by looking at various values of f from 0 to 1. The optimal f corresponds to the highest value of TWR.

3. Onceyou find f, take the root of degree N TWR (N is the total number of trades). This is your geometric mean for this market system. Now you can use the obtained geometric mean to compare this system with others. The f-value will tell you how many contracts to trade in this market system. Once f is found, it can be converted into the money equivalent by dividing the biggest loss by the negative optimal/. For example, if the largest loss is equal to $100, and optimal f = 0.25, then -$100 / -0.25 = $400. In other words, you should bet 1 unit for every $400 account. For simplicity you can calculate everything on a unit basis (e.g. one $5 chip or one futures contract, or 100 stocks). The number of dollars to allocate to each unit can be calculated by dividing your largest loss by the negative optimal f. The optimalf is the result of balancing the profitability of the system (based on 1 unit) and its risk (based on 1 unit). Many people think that the optimal fixed fraction is the percentage of the account that is allocated


Maybe it makes sense to go to logarithms. Replace the product by the sum
 
Vinin:

Maybe it makes sense to go to logarithms. Replace the product by the sum


Thank you Victor, it's possible, I'll have to try, but for now I'm testing this option of reducing the product - taking it to the power of 1/3.

//TWR — это «относительный конечный капитал» (Terminal Wealth Relative), 
 TWR = MathPow(TWR*(1+f*(-Mas_Outcome_of_transactions[orderIndex]/(D))),0.33); // TWR - это произведение всех HPR    
 
Roman.:


Well, how - because I did exactly that, only directly with respect to TWR - but not to its geometric mean G.

"For if the root of degree K of number_1 is greater than the root of the same degree K of number_2, then number_1 is greater than number_2! :))))))"

TWR is "relative finite capital" (Terminal Wealth Relative) ,

You have a missing transaction:

TWR = TWR* ...

I don't know how this will affect the Vince lot calculation, but My recommendation was not to exclude this operation.

My suggestion was to make the array TWR[]. And G counts like this:

G *= MathPow(TWR[orderIndex], 1/N);


Roman.:


Thank you Victor, it's possible, I'll have to try it, but for now I'm testing this variant of product reduction - taking it to the power of 1/3.

Even if you remove the third-degree root, there will still be no double overflow.
 
Roman.:
for ( orderIndex = 1;orderIndex<Qnt; orderIndex++) //при заданной f проходим по всем закрытым ордерам
{                                                  // и считаем относительный конечный капитал (TWR)
   TWR = TWR*(1+f*(-Mas_Outcome_of_transactions[orderIndex]/(D))); // TWR - это произведение всех HPR
}

And why do you have "orderIndex<Qnt" condition in the for() loop? So you are skipping the last element of the TWR array?
 
MaxZ:

You have a missing operation:

I don't know how this will affect the calculation of the Vince lot, but my recommendation was not to rule out this operation.

I suggested to make the array TWR[]. And G count like this:


Even if you remove the third-degree root, there will still be no double overflow.


I have an overflow, all other things being equal, including the total value: number of trades = 503 and max loss = 628...

You should check at your own place, on any of your boards - the code is posted on the first page - add in external variables and in the de-enith function... That's all.

 

MaxZ:


And why do you have exactly "orderIndex<Qnt" condition in your for() loop? It turns out that you skip the last element of the TWR array?


There is no TWR array at all, it is not necessary to organize it, it is enough to calculate f and that's all, it is only interesting to compare TWR at different f (in the loop) and that's all, to know f value at the maximal TWR and that's all.

Everything works fine there compare - first and last lines - value of profit on the last trade of "Log" and "Result" tabs respectively...


The trade numbers are different, as in my owl the closing is from the last order in the market to the first. The main thing is that the number beats - 503 deals - there (in the tester) and there (in calculationX) +

value of the last closed 503 trade 1076 - order search by history in the de-it function is performed from the beginning to the last (last) closed one.

 
Roman.:


TWR array - there is no need to organize it at all, it is enough to calculate f and that's all, it is interested only in comparison TWR at different f (in a loop) and all, to know value f at the maximum TWR and that's all.

Everything works fine there compare - first and last lines - the value of the profit on the last trade of the "Log" and "Result" tabs respectively...


Got completely confused. I meant the Mas_Qutcome_of_transactions[] array. Because it turns out that one of its elements is not counted in a loop...

And why should I look at the report if I see an inaccuracy in the code? I don't believe in miracles! :D

And maybe trades closed by the tester should not be taken into account? After all, it wasn't your TS that closed them...

 
MaxZ:

I'm completely confused. I meant Mas_Qutcome_of_transactions[] array. Because it turns out that the loop does not count one element in it...

And why should I look at the report if I see an inaccuracy in the code? I don't believe in miracles! :D

And maybe trades closed by the tester should not be taken into account? It's not by your TS that they were closed...


Yes, I'll check with condition <=Qnt. All trades closed by TS, the tester closed the last 10 (I believe this is within reasonable tolerance... :-))))
Reason: