Ralph Vince’s Optimal F Positioning Sizing
Forums › ProRealTime English forum › ProBuilder support › Ralph Vince’s Optimal F Positioning Sizing
- This topic has 23 replies, 1 voice, and was last updated 1 year ago by Gianluca.
Tagged: money management, position size
-
-
04/02/2017 at 10:05 PM #30763
With regard to money management your largest drawdown hasn’t happened yet but it will and it will increase with your capital growth. The best course of action would be to use Ralph Vince’s Optimal F strategy to only reinvest the square root of the capital growth, i.e. your capital goes from 10k to 20k but you don’t double the size of your trades (position size), i.e. you only trade the sq root of the increase in capital growth and attribute that ratio to position sizing: The sq root of 2(x) = 1.4. You will effectively be trading a £14,000 account. Therefore position size has not grown as fast as your capital and this will avoid large future drawdowns that will always typically be 50% more than you backtest results ever hinted out.
Can anyone code this for PRT as I have looked for it here but it’s not in the library:
This is a good Optimal F position size overview:
http://www.zorro-trader.com/manual/en/kelly.htm
123456789101112Examples of different investment methods// reinvest the square root of your portfolio component profits, separately for long and short tradesif(GoLong)Margin = OptimalFLong * Capital * sqrt(1 + (WinLong-LossLong)/Capital);elseMargin = OptimalFShort * Capital * sqrt(1 + (WinShort-LossShort)/Capital);// reinvest the square root of your portfolio component profitsMargin = OptimalFLong * Capital * sqrt(1 + ProfitClosed/Capital);// reinvest the square root of your total profitsMargin = OptimalFLong * Capital * sqrt(1 + (WinTotal-LossTotal)/Capital);Thanks for any help, input.
04/03/2017 at 1:52 PM #30825The link provided don’t explain how to calculate the Optimal F, because it is automatically calculated by this platform kernel.
This is the academic paper of Ralph Vince to explain how to get it: http://www.ralphvince.com/optimalf.pdf
I think I can make something as a function to plug into Probacktest program. But it’s kind difficult at first glance I must admit.
04/03/2017 at 3:23 PM #3083304/03/2017 at 5:11 PM #3085104/03/2017 at 6:26 PM #30868Thanks Nicolas, that’s some “interesting” mathematics in the paper… yes I realise now scanning through it that there is more to it because of the portfolio aspect. I was reading this International Federation of Technical Analysis paper: http://ifta.org/public/files/journal/d_ifta_journal_11.pdf (page 21) which gives a good overview and also suggests an improvement on Vince’s method.
I was actually going to suggest the same, to simplify things, if code was created that would be system specific. i.e. instead of calculating position sizing algos for multiple trading systems (as Vince intended) you perhaps write a code in the meantime that will tie the equity growth and trade size together by the Optimal F formula just for one trading system at a time? (so the code can be added into that specific system). I will continue researching it and see what i can dig up.
I still think, even as a “quick fix,” the Zorro approach would mitigate large future drawdowns that typically always exceed your backtest drawdowns by 50%!04/03/2017 at 6:42 PM #30870Re: The differences between the Kelly Ratio and Optimal F: (from page 22 of link above)
“Clearly, the Kelly Criterion when restated in terms of products (1a)(pls see screenshot) so that it is compared formulaically on an apples to apples basis with Optimal f (2)(see screenshot), rather than sums of logarithms (1)(see screenshot), is not the same. They do not yield the same answers for the values that maximize them except in the special case.
The value for f which maximizes (1,1a,1b[r=0]) is the same as the f which maximizes (2) only in what is referred to herein as the “special case” in trading defined as:
1) -W = the price of the underlying instrument when purchased, and
2) The position to be assumed is a long position only.When one or both of these conditions are not met, the Kelly Criterion (1,1a,1b[r=0]) not only results in a different value (for the optimal fraction to bet) than does the Optimal f solution (2), but can often result in a number that is greater than unity. This is because, as explained later, the Kelly Criterion doesn’t produce an “optimal fraction to bet,” but rather a leveraging factor. These numbers are identical only in the “special case.”
In the more common cases, the value that solves for the Kelly Criterion is not the optimal “fraction” of a trading account to risk. In all cases, the Optimal f solution will yield the correct growth- optimal fraction to wager. Thus, the Optimal f solution is a more generalized solution of which the Kelly Criterion is a subset, applicable in trading only when both conditions of the “special case” are satisfied. When these conditions are not both met (as is typically the case in trading) one must rely on the more generalized Optimal f solution (2) to yield the optimal fraction to risk.
Both conditions of the special case are met in a gambling situation. In such situations, the value for f which maximizes (1,1a,1b[r=0]) is the same as the f which maximizes (2), and thus the Kelly Criterion yields the same value as the answer provided by the Optimal f solution.”
”
04/03/2017 at 7:18 PM #30880Do you have a wordpress WP Edit plugin, it might make posting / editing on this site easier (-:
(Typically, when I ‘m not getting a “adding a url issue” or the “page jumping down” I get spacing issues – as seen above and for some reason now this post can now no longer be edited – although surely it should have remained editable until I logged out? or left the page?)04/03/2017 at 7:45 PM #30883This would be cool to have in PRT.
Here is a link to the simple version of optimalf as Ralph Vince suggests it for everybody who can not do the math, yet:
04/03/2017 at 10:06 PM #30891Thanks Derek, I came across this article too. I think the following two articles by:
http://www.brainyforex.com/position-sizing-methods.html and http://traders.com/Documentation/FEEDbk_docs/1998/07/Abstracts_new/Zamansky/Zamansky9807.html
might help @Nicolas to code a solution that gets rid of the problem of “wild swings” in equity and large drawdowns that can occur even when using Ralph Vince’s Optimal F.BRAINY FOREX:
Optimal FLike the Kelly formula, optimal f position sizing method is a specialized form of fixed fractional (fixed risk) position sizing. Optimal f position sizing method uses the fixed fraction that maximizes the geometric rate of equity growth. This method was developed by Ralph Vince as a more accurate version of the Kelly formula. Unfortunately, optimal f has many of the same drawbacks as the Kelly formula. Namely, the optimal f value often results in drawdowns that are too large for most traders to tolerate. As with the Kelly formula, the position size based on the optimal f is often so high that it’s limited by margin requirements.
The optimal f value is calculated according to an iterative procedure that maximizes the geometric growth rate for the current sequence of trades. The calculation for the position size is the same as for the Kelly formula except that the optimal f value is used in place of the Kelly f value. The trade risk is taken as the largest historical loss per unit. As with the Kelly formula, optimal f position sizing is included primarily for educational purposes.
Secure F
Leo Zamansky and David Stendahl tried to overcome large drawdowns Optimal f by adding a special limit of maximal allowable drawdown. Secure F solves a task:
Net Profit -> Max (similarly Optimal f) under condition Max Drawdown <= Max Allowed Drawdown.
The difference between the Secure F and the Optimal f position sizing methods is that in case of Secure F the drawdown will be taken into account. Value of Secure F can never be higher that the value of Optimal f.
Number of units = (Secure F * Current Capital/starting risk per unity of assets)/Security Price
where starting risk = maximal loss at trade(in %).Example:
1234567891011Current Capital = $2,000,000 ($10,000 with margin factor of 200).Currency Price = 1.2785Max DrawDown = 20% (value of maximal allowed DrawDown)Secure F = 0.10 (value of maximal allowed DrawDown)Maximal Loss at trade = 50%In this case you can buy (0.1 * 2,000,000/0.5)/1.2785 = 312,867/0.2 = 156,433 units.($200,000)———————————————————————————————————————————————————————————————–
TRADERS . COM
Here’s how to find a new fractional value of capital to invest in every trade to maximize returns subject to a constraint on drawdown, using a variation of the optimal f money management strategy:
Vince introduces optimal f, and to find the value of optimal f, we need to maximize what Vince calls terminal wealth relative (TWR). The problem can be formulated thus:
123456TWR(f) -> maxwhere TWR(f)=(HPR1(f))((HPR2(f))(...(HPRn(f))HPRi(f)=1+(f((-Return on the trade i)/(Return on the worst losing trade))HPR = Holding period return(Please see Zaminsky screenshot)
———————————————————————————————————————————————————————————————–
NOTE:
The IFTA conclusion below also addresses the issue of not knowing where the the optimal point will be in the future (we’re using past probabilities).
A solution has been provided (see italics) in the IFTA Research Paper’s Conclusion: (page 26)“The above findings (singularities and discontinuities in geometric growth) have important implications for a trader wishing to implement Optimal f in his future trading. One of the major impediments to implementing the usage of Optimal f for geometric growth in trading is the lack of knowledge as to where the optimal point will be in the future.
Since the Optimal f case will necessarily bound the future optimal point between zero and p (the sum of the probabilities of the winning scenarios), the trader need only perceive what p will be in the future. From there, trading a value for f of p/2 will minimize the cost of missing the peak of the Optimal f curve in the future.
This occurs because each point along the Optimal f curve varies with the increase in the number of plays (time), T, as GT, where G is the geometric mean holding period multiple as given in Equation (2)(see previous screenshot). Thus, at T=2, the price paid for being at any future f value other than the optimal value is squared, at T=3, the penalty is cubed. Just as with the measure of statistical variance, outliers cost proportionally more. Although the trader cannot judge what will be the future value for Optimal f, by using the value of p/2 as the future estimate of the Optimal f, the trader minimizes this cost and is able to make a “best guess” estimate of what the future value for Optimal f will be.
Note that the trader uses a predicted value for p in determining his future “best guess” for f . The greatest amount the trader might miss actually is the optimal point in the future and is the greater of p/2 or what we call p’, which is what p actually comes in as in the future window, p’ – p/2. These extreme cases manifest when the trader opts for f = p/2 and the future Optimal f=0, or, the trader opts for f = p/2 and the future Optimal f=p’. Thus, the greatest outlier, when the trader is opting to use a “best guess” for his future Optimal f = p /2 is minimized as the greater of p/2 and p’-p/2.
Because the Kelly Criterion Solution is unbounded to the right, we are not afforded this outcome unless, we convert it to its Optimal f analog.
At no losses, the Kelly Criterion solution is infinitely high, and only by convention can we conclude that the corresponding Optimal f is 1.0. The point of singularity we witness in Optimal f is mathematical, the discontinuity, by convention.”
09/24/2017 at 7:22 PM #47156I want to resurrect this thread. I’m also interested in optimal f position sizing but see no real possibility to incorporate it PRT. The best I have come up with so far is to calculate it in excel and then update the position size in the code manually.
Has anybody a better solution?
09/26/2017 at 9:57 AM #4736609/26/2017 at 10:02 AM #47372I actually had an idea how to calculate the TWR without arrays. Not sure that it’ll work though. I will see if I can solve it.
For the application of this (or any other) MM it would be really great if one could see the account equity in PRT. 🙁
09/26/2017 at 5:26 PM #4742409/26/2017 at 7:26 PM #4743109/26/2017 at 7:32 PM #47433 -
AuthorPosts
Find exclusive trading pro-tools on