tag:blogger.com,1999:blog-35364652.post1560782960143176110..comments2024-03-22T10:29:59.088-04:00Comments on Quantitative Trading: Kelly formula revisitedErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-35364652.post-50569380393120861392014-05-01T10:29:52.984-04:002014-05-01T10:29:52.984-04:00Hi Unknown,
If your average number of levels is 2,...Hi Unknown,<br />If your average number of levels is 2, and the optimal leverage is 2 also, then each level should get a leverage of 1, even though sometimes you might get up to 5 levels.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-78410504168259928622014-05-01T09:25:19.765-04:002014-05-01T09:25:19.765-04:00Thanks For the reply Ernie...
I would request fur...Thanks For the reply Ernie...<br /><br />I would request further view from your side on this problem at hand.<br /><br />Let's say my optimal leverage comes at 2x<br /><br />Now let's say in the lookback period, my average levels comes at 3 .... how would now i decide what should be the bet size in level 1, level 2, level 3 , level 4 and level 5.<br /><br />Some light on this would be really appreciated.<br /><br />Regards<br /><br />PuneetUnknownhttps://www.blogger.com/profile/12377997115839026588noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-40015419117446258962014-04-30T13:01:52.353-04:002014-04-30T13:01:52.353-04:00Hi Unknown,
First, Kelly formula is based on unlev...Hi Unknown,<br />First, Kelly formula is based on unlevered returns, so you first have to calculate that properly: it is the P&L divided by the gross market value. In your case, the gross market value may double or triple for some period due to the 5 levels of entries.<br />Second, after the optimal leverage is calculated based on your unlevered returns, it refers to the average leverage. So you have to determine the average number of levels you use, and use that and the optimal leverage to compute the bet size for one level.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-85044765796870785822014-04-30T12:27:34.352-04:002014-04-30T12:27:34.352-04:00Hi Ernie,
I have back tested a strategy where in...Hi Ernie,<br /><br /><br />I have back tested a strategy where in there are number of continuous buy signals and sell signals. For eg, I have a buy, then another buy trigerrs and subsequently another 3 buys trigger..I have limited 5 number of consecutive buys and similarly max number of sells at 5. At times there maybe only 1 buy followed by 1 sell and so forth so on. My system is based in retracement of prices.<br /><br /><br />Now in this kind of scenario, how do I determine the optimal leverage and also the optimal bet size for a given size of portfolio of say 1 million usd using Kelly ?<br /><br />Unknownhttps://www.blogger.com/profile/12377997115839026588noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-19530354429825428392013-03-25T12:37:24.454-04:002013-03-25T12:37:24.454-04:00I know the kelly criterion gets a bad rap a lot of...I know the kelly criterion gets a bad rap a lot of times, but the truth is that it's the best money management system out there. When you put it up against any other system it wins hands down for the rate of return it produces relative to <a href="http://rldinvestments.com/Kelly%20Calculator/js/Money%20Management.html" rel="nofollow">bankroll</a> size and volatility. The reason people don't really understand it is because it is only half of the equation. Most people can't predict winners consistently or evaluate their edge accurately. Without those two things the kelly calculator won't help you much.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-59626331275472755552013-02-26T14:56:58.137-05:002013-02-26T14:56:58.137-05:00EdL,
You can use compounded returns for your backt...EdL,<br />You can use compounded returns for your backtest. The compounded returns should of course be calculated using levered per period returns.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-54293149774275450662013-02-26T14:39:19.508-05:002013-02-26T14:39:19.508-05:00Thanks Ernie. Yes, I hadn't thought about the...Thanks Ernie. Yes, I hadn't thought about the Sharpe ratios being the same.<br /><br />Regarding the use of compounding growth in the backtest from which I will calculate the Sharpe; would you recommend this approach if it is more realistic to the way I would trade for real? <br /><br />Or would you recommend running the backtest with a set fixed amount per trade? <br /><br />(The latter is the way I have been running backtests up until now, in order to compare like for like when testing various strategies, but I feel using compounding growth may be a better approach.)<br /><br />Many thanks,<br /><br />EdEdLnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-13388540414971732692013-02-26T07:10:32.882-05:002013-02-26T07:10:32.882-05:00Hi Ed,
Sharpe ratio should always be calculated us...Hi Ed,<br />Sharpe ratio should always be calculated using non-levered returns. But in any case, it should be the same even if you apply leverage, as it affects both the numerator and denominator by the same factor.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-272941730882377692013-02-26T06:37:17.901-05:002013-02-26T06:37:17.901-05:00Hi Ernie,
Some great info and discussion here on ...Hi Ernie,<br /><br />Some great info and discussion here on Kelly.<br /><br />I've recently been backtesting a strategy without using any leverage or compounding growth. In my backtests I limit my open positions to 1 contract of the same amount each time (with a fixed estimate of comission and slippage per trade). I'm now keen to try and model a more realistic backtest of how my strategy would perform when leverage and position sizing (using the Kelly formula) and compound growth are taken into account.<br /><br />Question 1: Is it ok to take the Sharpe ratio from my existing (un-levered, non-compounding) backtest and use that as the starting point to calculate the leverage I should use for my more realistic backtest?<br /><br />Question 2: After having run a more realistic backtest taking leverage into account, I will have a new Sharpe ratio. <br />If I were then to start paper trading, should I use this new Sharpe ratio as my starting point? <br /><br />i.e. Should I take my starting Sharpe ratio from a levered (with compound growth) or un-levered (and non-compounded growth) back test? <br /><br />Many thanks,<br /><br />EdEdLnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-57701422919222874492013-01-23T15:40:58.126-05:002013-01-23T15:40:58.126-05:00Hi Anon,
Certainly, changing a CEO for a company c...Hi Anon,<br />Certainly, changing a CEO for a company can be considered a regime shift for a company. But for a strategy, some market-wide discontinuity need to occur.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-80045720680382341612013-01-23T12:20:47.282-05:002013-01-23T12:20:47.282-05:00Hi Ernie,
Do you think that perhaps that this sub...Hi Ernie,<br /><br />Do you think that perhaps that this subjective element of working out if there is a "regime shift" then makes it reasonably similar to picking stocks...i.e. if being long APPL was your strategy for example, (at what ever leverage ratio you want), and then you saw a series of negative returns...or you believe there is a "regime shift" due to say for example a change in CFO or perhaps more subtely a change in advertising approach ... then this subjective element is not too dissimilar to looking for past winners and hoping that they stay as winners in the future and hoping that there is no "regime shift" in the future but just doing it for strategies rather than single stock companies?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-53933151213455765702013-01-23T08:40:13.992-05:002013-01-23T08:40:13.992-05:00Hi Anon,
If 500 days give different leverage than ...Hi Anon,<br />If 500 days give different leverage than 300 days or 100 days, then we should use 500 days, unless you think the regime has shifted in the last 300 or 100 days.<br /><br />One should use the longest lookback possible consistent with the current regime.<br /><br />Of course, this sounds clear-cut, but how do you determine a "regime"? That is the more subjective part of the business, and relies on your fundamental knowledge or judgement. Obviously, a strategy that depends on shorting stocks will experience regime shifts if the short-sale rule changes.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-80095436056241294962013-01-23T08:31:38.465-05:002013-01-23T08:31:38.465-05:00Hi Ernie,
Thanks for your quick response.
Agree...Hi Ernie,<br /><br />Thanks for your quick response. <br /><br />Agreed that loosing money doesn't alway suggest a regime shift. <br /><br />So i guess my question is under what circumstances would you change the look-back period..and if you decide not to change it (as you suggested)..then why focus on 500 days? or any other arbitrary number of days? <br /><br />Which also goes to my original issues of what if using a 500 day window suggests leverage of 3x but using a 200 day window suggests using 1.5x...and on a 100 day window it suggests -2x....from a money management perspective... this is perhaps a bit worrying...as you would be staking very different amounts for your next bet/trade...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-11476041265352694932013-01-23T08:10:35.060-05:002013-01-23T08:10:35.060-05:00Hi Anon,
Merely losing money does not necessarily ...Hi Anon,<br />Merely losing money does not necessarily signal a regime shift. As I said, it is hard to detect one in real-time. So my practice is to not change the lookback just because a strategy is losing money, unless I have fundamental reasons to believe there is a regime shift.<br /><br />However, the beauty of Kelly formula is that once you start losing money, the market value of your portfolio will be reduced even if you keep the same leverage.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-49960104225268980432013-01-23T08:05:33.917-05:002013-01-23T08:05:33.917-05:00Thanks for your answer Ernie,
On your point about...Thanks for your answer Ernie,<br /><br />On your point about the regime shifts, if running a strategy...that for lets say for the sake of simplicity buys SPY at 1pm and sells it at 2pm (on the reason say that you think ETFs might carry out hedges at this time), and you found that this was profitable over time, calculated an optimal leverage ratio using a 500 day window say its 3x...but then your strategy starts too loose money quickly due to a "regime shift". At 3x leverage...i can imagine that you might loose a lot of your trading capital quite quickly...<br /><br />when do you make the call that that 500 days might be too long and that you might want to shorten it or lengthen it? and even if you did length or shorten the window of optimal leverage calculation...does it not merely change the leverage ratio? and if shortened enough could it not then start suggesting negative leverage, i.e. due to money management rules, would be reversing your once profitable strategies. i.e. instead of buying at 1pm you would be selling?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-48380159660644257292013-01-14T11:18:41.563-05:002013-01-14T11:18:41.563-05:00Hi,
The 500 day moving window is only valid if you...Hi,<br />The 500 day moving window is only valid if you believe, based on fundamental considerations, that there is no regime change affecting the profitability of your strategy. <br /><br />If there is such a fundamental shift, we need to adapt the window accordingly. <br /><br />In practice, we can usually only discern a regime shift in retrospect, but that is good enough for us in determining what window to use.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-77561851488309404252013-01-14T09:22:45.497-05:002013-01-14T09:22:45.497-05:00Hi i was wondering why did you decide upon a 500 d...Hi i was wondering why did you decide upon a 500 day moving window for continually recalculating your leverage ratio? should this number be optimised? What happens if your kelly optimal leverage changes dramatically according to the window chosen...what does that suggest to you? Your thoughts would be appreciated.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-43487903945854636292012-04-24T12:30:46.874-04:002012-04-24T12:30:46.874-04:00Basically (from what i understand), he's using...Basically (from what i understand), he's using the multinomial probability distribution implied by a series of trades from a backtest.<br /><br />That's where he gets the "biggest loss" number.<br /><br />Then, it makes sense that the optimal f is between 0 and 1.<br /><br />What is not so clear for me is how you accomodate this "Optimal f" with leverage?<br /><br />Let's say your biggest loss on a given trade was 30% and optimal f is 0.4, do you leverage yourself to <br />(1.0/30%) x 0.4) = 133% of your AUM ??<br /><br />My 2 cents.regis99noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-27136550894460599972011-11-11T03:41:51.716-05:002011-11-11T03:41:51.716-05:00I'm also interested in a more detailed derivat...I'm also interested in a more detailed derivation of Kelly's formula for the multiple security continuous case. Thorpe's paper is very good, though he skips a lot of steps and I'm not able to easily fill in the blanks at my current level of math skill. Specifically, the parts about product series expansion and later the covariance matrix.<br /><br /><br /><br />Tangentially, does anyone understand Ralph Vince's optimal f? [http://www.epiheirimatikotita.gr/elibrary/finance/The%20Mathematics%20of%20Money%20Management%20-%20Risk%20Analysis%20Techniques%20For%20Traders%20%28Ralph%20Vince,1992%29.pdf p.31, "FINDING THE OPTIMAL f BY THE GEOMETRIC MEAN"]<br /><br />How can he be finding the optimal f without assuming any probability distribution first? The part "-trade/biggest loss" is never proven or even explained... seems like nonsense?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-39159657639545826072011-01-21T17:55:22.181-05:002011-01-21T17:55:22.181-05:00Hi Mak,
You can check out the Recommended Books se...Hi Mak,<br />You can check out the Recommended Books section on the right sidebar of my blog.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-80201124790243783122011-01-20T15:04:03.776-05:002011-01-20T15:04:03.776-05:00Mak
Hello, Ernie
I'm currently a junior in ...Mak <br /><br />Hello, Ernie<br /><br />I'm currently a junior in university studying math. Algothimic Trading is certainly not in my future career, but it is something I would like to learn as a side project. I've flipped through the vast amounts of information on the web, and I was curious, aside from your book, what are some other useful books to start learning such material?Maknoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-26026936319013285932010-05-31T10:06:19.034-04:002010-05-31T10:06:19.034-04:00Ralph Vince has written a new paper on the distinc...Ralph Vince has written a new paper on the distinction between optimal f and Kelly's criterion, which addresses some of the issues posted here. You can download it here: http://parametricplanet.com/rvince/optfnkelly.pdfErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-90155374425092918722010-05-18T08:01:13.693-04:002010-05-18T08:01:13.693-04:00Interesting to read about cointegration. My thesis...Interesting to read about cointegration. My thesis was about it so a nice trip down memory lane.financial spread bettinghttp://www.financialspreadbettingsystem.co.uknoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-81983099206325468462010-04-09T09:48:43.732-04:002010-04-09T09:48:43.732-04:00J,
By the way, you can read detailed description o...J,<br />By the way, you can read detailed description of Thorp's formulation either in my book "Quantitative Trading", or on his website http://edwardothorp.com/.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-43047722283188886012010-04-09T09:47:52.057-04:002010-04-09T09:47:52.057-04:00J,
I believe you are referring to Ralph Vince'...J,<br />I believe you are referring to Ralph Vince's formulation of Kelly's formula in your last 2 posts. Vince's formulation is based on a bet with discrete outcomes, hence the notion of win/loss ratios etc. I followed Ed Thorp's continuous finance formulation in computing Kelly formula, which only requires mean and variance of returns. Also, Thorp's formulation is all about determining the optimal leverage, so the answer to your first question is: "obviously yes".<br />And if you follow Thorp's formula, the scenario in your second post will never happen.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.com