tag:blogger.com,1999:blog-261139923818144971.comments2017-08-23T14:05:58.181+01:00Investment IdiocyRob Carvernoreply@blogger.comBlogger1134125tag:blogger.com,1999:blog-261139923818144971.post-90276386865796049972017-08-23T14:05:40.060+01:002017-08-23T14:05:40.060+01:00Thanks for clarifying, Rob and you're welcome....Thanks for clarifying, Rob and you're welcome. Its a tiny contribution compared to the ocean of wisdom you have imparted.Patrickhttps://www.blogger.com/profile/01034323689613977187noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-36821634671681868722017-08-23T13:20:03.789+01:002017-08-23T13:20:03.789+01:00Hi Patrick. You've clearly thought about this ...Hi Patrick. You've clearly thought about this very deeply, and actually I'm coming to the conclusion that you are right (and indeed Stephen is wrong!) which also means that the risk targeting in my book is exactly right. We shouldn't really think about 'risk' when measuring forecast dispersion. You are correct to say that if the average absolute value is 10, and the system is scaled accordingly, then the risk of the system will be whatever you think it is. You'd only be at risk of mis-estimating the risk if you used MAD to measure the dispersion of *instrument returns*. Thanks again for this debate, it's great to still be discovering more about the subtleties of this game.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-10059976719109549542017-08-23T06:30:21.209+01:002017-08-23T06:30:21.209+01:00Thanks!Thanks!ธนสาร พัวทวีพงศ์https://www.blogger.com/profile/07593784591152311051noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-11362862546727942382017-08-22T19:39:14.525+01:002017-08-22T19:39:14.525+01:00Hi Rob, you haven't confused things. I think I...Hi Rob, you haven't confused things. I think I have explained myself poorly. I sort of get the link between MAD and stdev (albeit only after reading the comments above, your post on thresholding AND a little bit of googling). Its a nice way quickly to target average risk directly. What I am struggling with is Stephen's observation, "doesn't this mean that you are taking on 25% too much risk?". When looked at from the perspective of average risk, I don't see that you are. I have spent some time thinking about this, so if I have got it wrong, I apologise in advance for not getting it (aka 'being thick'): <br /><br />The system is either long or short. If we split the normal distribution of the forecast into two halves, then once properly scaled, the conditional mean forecast given a short is -10, and the conditional mean when long is +10 (unconditional mean is obviously 0). Hence the average risk in a subystem comes from a position equating to 10 forecast ‘points’ which is how you have designed your system. This implies the second moment ~ 12.5, but to my mind, the second moment doesn't impact average 'risk' which is a linear function of the averages in conditional halves of the gaussian. And this average is still 10 and therefore translates to desired average position size in your system over time. In a nutshell, I am struggling to equate the 'dispersion' of forecasts with 'average risk' in the system and this where my thinking deviates from Stephen's observation. Patrickhttps://www.blogger.com/profile/01034323689613977187noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-54913881427966289902017-08-22T15:30:55.029+01:002017-08-22T15:30:55.029+01:00Average absolute value (also called mean absolute ...Average absolute value (also called mean absolute deviation) and standard deviation are just two different measures of the second moment of a distribution (it's dispersion), the difference being of course that the MAD is not corrected for the mean, whilst the standard deviation is indeed standardised (plus of course the fact that one is an arithmetic mean of absolute values; the other a geometric mean). <br /><br />Their relationship will depend on the underlying distribution; whether it is mean zero, or Gaussian, or something else. <br /><br />[For instance with any Gaussian distributions mean zero MAD~0.8*SD. If the mean is positive, and equal to half the standard deviation, then MAD~0.9*SD. You can have a lot of fun generating these relationships in Excel...]<br /><br />So doubling the standard deviation of a mean zero Gaussian will also double it's average absolute value.<br /><br />Because we scale our target vol both measures work equally well to measure the dispersion of the risk, as well as the average absolute risk. Indeed at AHL we used both MAD and SD for forecast scaling at different times. <br /><br />I appreciate that intuitively they seem to mean different things; but they are inextricably linked. The reason I chose MAD rather than SD in my book was deliberately to play on the more intuitive nature of MAD as a measure of average risk - I'm sorry if it has confused things.<br /><br />Anyway, I hope this clears that up a little. <br /><br />As to your final point, yes with a +/- 20 cap on a Gaussian forecast we are indeed capping 10% of the values.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-15484221931718634992017-08-22T14:23:50.218+01:002017-08-22T14:23:50.218+01:00Hi Rob
Congratulations on the great first book whi...Hi Rob<br />Congratulations on the great first book which I thoroughly enjoyed reading. I am trying to follow the logic presented by Stephen above. Is the vol of the forecast a reflection of system risk? My understanding is that the forecast vol is a measure of the dispersion of the risk over time whereas average values in either half of the gaussian is the measure of the average risk. The fact the average abs forecast is linked to implied sdev of a gaussian forecast does not appear to my mind to change that. Finally with caps at +- 20 in a gaussian dist it seems you are compressing 10% (or more if tails are fatter) of the extremities as sdev is 12.5 (and +-20 equates +- 1.6 sd). Or have I misunderstood something?Patrickhttps://www.blogger.com/profile/01034323689613977187noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-64754816566960385562017-08-22T09:40:33.426+01:002017-08-22T09:40:33.426+01:00I've replied on stack overflow.I've replied on stack overflow. Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-85454180106210003252017-08-22T08:24:41.595+01:002017-08-22T08:24:41.595+01:00Hey Rob Can I ask you I want to get a set of a His...Hey Rob Can I ask you I want to get a set of a Historical data. I have post it on stack overflow do you have any suggestion?<br /><br />https://stackoverflow.com/questions/45793114/how-to-get-series-of-requests-in-ibapi-on-pythonUnknownhttps://www.blogger.com/profile/07593784591152311051noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-62023192279249315202017-08-21T09:58:51.983+01:002017-08-21T09:58:51.983+01:00The risk of a problem if the broker goes bust is, ...The risk of a problem if the broker goes bust is, I think, minimal. The extra interest you will earn is also, right now, minimal. Weighed up against that if you own an ETF you'll incur management fees and be exposed to some risk, and trading costs if you have to adjust the size of your margin.<br /><br />Having said that there is no strict right or wrong on this issue. Some big CTAs are strictly cash only. Others do indeed use short term US government bonds.<br /><br />Of course you don't have to put the other 80k (or whatever) into your brokerage account. You can keep it in another account, and only keep enough in your brokerage account to cope with an extreme shock to your p&l. You then shuffle money across regularly as required. Slightly risk and requires more work - but again this is what a large CTA would do. Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-71557588146300430092017-08-21T09:44:52.602+01:002017-08-21T09:44:52.602+01:00In theory you should do that... in practice I have...In theory you should do that... in practice I haven't bothered since it would be a very complex exercise and result in extra trading that would probably wipe out the benefits. To deal with this properly you'd have to set the problem out in a precise algorithim, with a generalised non linear mapping whose parameters are determined by your current capital. Then you'd get a smooth transition as your capital changes. This isn't that difficult to do, but it's not something I'm personally going to bother with.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-86106378153441373482017-08-20T21:56:24.142+01:002017-08-20T21:56:24.142+01:00HI Rob, what is your thinking here? I ask because ...HI Rob, what is your thinking here? I ask because I have read other opinions along the lines of "don't keep much cash in your brokerage account; keep it in a low risk e.g. short rates or money market fund: in the event of your broker going bankrupt, getting any securities returned is quicker than getting any cash returned (if it has not already gone)".JMW100https://www.blogger.com/profile/18171394406805453830noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-45095331093436734132017-08-20T21:52:15.220+01:002017-08-20T21:52:15.220+01:00Hi Rob, do you revisit the number of instruments i...Hi Rob, do you revisit the number of instruments in the event of (large enough) drawdowns. For example, one of your examples is "With a capital of $2.2 million you could hold 37 instruments with a maximum position of at least 2 contracts in each". If one were to suffer a drawdown of say 30% (not unheard of at your preferred level of target volatility) and capital is reduced, do you then start removing instruments from your portfolio? I presume at 1.32MM, that is no longer enough to support the 37 instruments?JMW100https://www.blogger.com/profile/18171394406805453830noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-25440986349044307872017-08-19T09:05:30.488+01:002017-08-19T09:05:30.488+01:00Watch this space!Watch this space!Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-8158430164162937062017-08-18T22:56:37.301+01:002017-08-18T22:56:37.301+01:00Congratulations! Will there be raffle for signed c...Congratulations! Will there be raffle for signed copies?JMW100https://www.blogger.com/profile/18171394406805453830noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-17582452074532680352017-08-17T12:03:18.688+01:002017-08-17T12:03:18.688+01:00Ok - if you download the new GIST link and you'...Ok - if you download the new GIST link and you're using both the latest gateway and API then this should work now.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-58861369681473521892017-08-17T11:53:41.813+01:002017-08-17T11:53:41.813+01:00I've updated my API software and now I'm g...I've updated my API software and now I'm getting the same error. It looks like IB have changed the historicalData function arguments (why they keep ****** doing this I don't know...). I'll have to modify the code to cope with this... Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-47045910868681337402017-08-17T03:28:30.793+01:002017-08-17T03:28:30.793+01:00I got the same error "historicalData() missin...I got the same error "historicalData() missing 8 required positional arguments..."Willhttps://www.blogger.com/profile/05869414433738815032noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-26631427478077085002017-08-16T03:18:50.738+01:002017-08-16T03:18:50.738+01:00I have read chapter 14 again and it was helpful.
...I have read chapter 14 again and it was helpful.<br /><br />I should have checked the book before I asked.<br /><br />Thanks for reply.Minkyu Kimhttps://www.blogger.com/profile/12721284558759239431noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-6658635101434228802017-08-15T10:35:09.560+01:002017-08-15T10:35:09.560+01:00Sorry I didn't read the trace properly. It say...Sorry I didn't read the trace properly. It says ALL the arguments are missing. That's very strange. I can't seem to reproduce the error which suggests you have a path, or similar, problem.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-16785131487645632632017-08-15T04:45:30.357+01:002017-08-15T04:45:30.357+01:00Hello Rob,
are you referring to Wessel's fix ...Hello Rob,<br /><br />are you referring to Wessel's fix above? I am using the latesst GIST (updated July 6) and getting the same error as him.John Ohhttps://www.blogger.com/profile/08196764498447702091noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-44299841715272537322017-08-15T04:38:06.896+01:002017-08-15T04:38:06.896+01:00Hello Rob,
are you referring to Wessel's fix?...Hello Rob,<br /><br />are you referring to Wessel's fix?<br /><br />'<br />On line 239, you need to add now (for API 9.73.2):<br />"TRADES", # whatToShow,<br />1, # useRTH,<br />1, # formatDate<br />False, # KeepUpToDate <<==== add this<br />[] ## chartoptions not used<br />)<br /><br />Else you get the error: TypeError: reqHistoricalData() missing 1 required positional argument: 'chartOptions'<br />'<br /><br />I'm using the latest gist and still getting the same error as the commenter.Unknownhttps://www.blogger.com/profile/08196764498447702091noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-58107513008930472542017-08-14T12:22:09.255+01:002017-08-14T12:22:09.255+01:00Sorry - optimise might be the wrong word - I just ...Sorry - optimise might be the wrong word - I just meant estimating correlations using a longer sample period. I'm sure this is discussed in the book...<br /><br />Noticed that the new book is available for preorder (you might want to draw people's attention to that!) and am now looking forward to reading it next month...Jamiehttps://www.blogger.com/profile/12123255625489532104noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-81347549347314051292017-08-14T11:39:59.462+01:002017-08-14T11:39:59.462+01:00You have it exactly right.
"If my take on it...You have it exactly right.<br /><br />"If my take on it is correct, if one uses just daily data in the backtest could both the volatility and turnover estimated be too low?"<br /><br />It shouldn't affect volatility estimates. But yes in theory turnover will be higher. But as you say the effect is tiny for slow trading.<br /><br />Eventually I will switch from this overcomplicated system to a simple daily system based on the prior days close.<br /><br />GATRob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-48856436433494955842017-08-14T11:37:58.946+01:002017-08-14T11:37:58.946+01:00Solution 1 is correct. Chapter 14 actually discuss...Solution 1 is correct. Chapter 14 actually discusses exactly this problem so it might be worth (re) reading it.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-47864533049331064152017-08-14T11:35:52.407+01:002017-08-14T11:35:52.407+01:00"I suspect the answers may come in your next ..."I suspect the answers may come in your next book (which I will be preordering as soon as possible!)"<br /><br />Yes! Broadly the more countries you have the more funds you should hold. It takes me over 500 pages to explain exactly how you work this out so I can't really answer your detailed questions here in such a short space.<br /><br />"Finally, you mention that you can only optimise over a one year period due to insufficient data - could you not use a proxy in this instance? For example, if there was only 1 year of data for the FTSE 100 ETF, could you use the FTSE index (whether price or total return) as a proxy in the bootstrap? "<br /><br />In fact I'd avoid optimisation since I don't think it adds much value here - again this is covered in the new book.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.com