tag:blogger.com,1999:blog-35364652.post8230965571724080508..comments2017-07-22T09:31:26.000-04:00Comments on Quantitative Trading: Paradox Resolved: Why Risk Decreases Expected Log Return But Not Expected WealthErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-35364652.post-20259590452740200812017-07-20T07:00:37.573-04:002017-07-20T07:00:37.573-04:00Hi,
Cumulative returns are more meaningful.P&...Hi, <br />Cumulative returns are more meaningful.P&L depends on the size of your orders and is arbitrary.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-44331375192297677702017-07-19T22:56:53.194-04:002017-07-19T22:56:53.194-04:00Hi Ernie,
When we do backtesting, shall we use c...Hi Ernie,<br /><br />When we do backtesting, shall we use cumulative pl or cumulative return to evaluate performance? What are their strength or weakness?<br /><br />Thanks.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-7087857709272656402017-07-19T08:37:41.290-04:002017-07-19T08:37:41.290-04:00Hi,
The typical way is to subtract some fixed perc...Hi,<br />The typical way is to subtract some fixed percentage from each trade's returns. My first book Quantitative Trading has detailed examples on this.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-5593293347262728672017-07-18T23:55:52.348-04:002017-07-18T23:55:52.348-04:00Hi Ernie,
Thank you for quick response!
When we ...Hi Ernie,<br /><br />Thank you for quick response!<br /><br />When we evaluate performance via profit&loss(pl) and cumulative pl, it is straightforward to include transaction costs.<br /><br />When we evaluate performance via net return and cumulative return, how do we include transaction costs?<br /><br />Many thanks.<br /><br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-5581412289105555722017-07-18T08:54:19.125-04:002017-07-18T08:54:19.125-04:00Hi,
Log return = log(price(t))-log(price(t-1))
Ne...Hi,<br />Log return = log(price(t))-log(price(t-1))<br /><br />Net return = price(t)/price(t-1) -1<br /><br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-88474123201385864172017-07-18T08:44:19.695-04:002017-07-18T08:44:19.695-04:00Hi Ernie,
What is the difference between log retu...Hi Ernie,<br /><br />What is the difference between log return and net return?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-59978983177263834012017-07-18T06:39:50.677-04:002017-07-18T06:39:50.677-04:00Hi,
Yes, for signal generation, not for performanc...Hi,<br />Yes, for signal generation, not for performance evaluation. The latter need to conform to the industry norm - which uses net return.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-20412434851051244192017-07-17T20:22:56.106-04:002017-07-17T20:22:56.106-04:00Hi Ernie,
Do you use log return during backtestin...Hi Ernie,<br /><br />Do you use log return during backtesting?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-61666151110616730032017-07-15T08:10:43.985-04:002017-07-15T08:10:43.985-04:00Hi Alex,
1) SVM is a classification algorithm, can...Hi Alex,<br />1) SVM is a classification algorithm, can only be used to predict direction of price moves.<br />2) Random forest can be applied to either classification or regression trees. The latter can be used to predict magnitude as well as direction of moves.<br />3) There is no reason to believe one is superior to the other with respect to various out-of-sample (OOS) performance measures.<br />4) Daily price is good enough if you aggregate >1,000 stocks and build the same model for all.<br />5) If a feature was found to work OOS, then of course one should retain it in library. There aren't that many features that work OOS, so no worries about "too many". We can only have too many unproven features - that lead to data snooping bias.<br />6) My book references many other books and articles. In terms of AI in trading, I recommend following @carlcarrie on Twitter, which posts numerous relevant articles daily.<br /><br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-34152931114268247302017-07-14T21:11:03.546-04:002017-07-14T21:11:03.546-04:00Hi Ernie,
I've listened to a couple of your t...Hi Ernie,<br /><br />I've listened to a couple of your talks online and had a few questions after reading your blog. My background is fundamental investing at asset management and hedge funds and only more recently have I tried to pick up machine learning. <br /><br />In one of lectures, you referenced SVM and random forest as two algorithms that work well for stock prediction. However, I wasn't clear if this is a classification or regression problem. In other words, what is more appropriate, to predict the actual stock price, the actual return or if the stock with be up or down? I've seen a lot of academic papers and I've seen a mix of what people do but I've seen no explanation as to the pros and cons of use one over the other. Perhaps you could enlighten me here.<br /><br />My second question is regarding one of your comments about insufficient data. Are you saying that daily price data for your y label is not enough and you need minute by minute data? <br /><br />And my third question has to do with one of your slides where you say feature rich data sets are a curse. I've read about this before so I'm not questioning what you're saying. However, I remember listening to a talk given my James Simons, and he said that once they find a good predictor they just leave it in in case it comes back. If that's the case, then over time, they would like have a substantial number of features in the model. Are they doing something that perhaps is different?<br /><br />My last question is about your recent book or perhaps you have a suggestion of other resources. I'm trying to find a resource that clearly shows right way to clean and transform feature data and cross validate in order to use it for prediction. I've not seen a source that accurately describes best practices.<br /><br />Thank you,<br /><br />Alex<br /><br /><br /><br /><br /><br /><br />Alexnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-6143439676377351042017-07-11T17:47:58.568-04:002017-07-11T17:47:58.568-04:00Hi Ever,
Yes, as I have shown in another blog post...Hi Ever,<br />Yes, as I have shown in another blog post (https://epchan.blogspot.ca/2014/08/kelly-vs-markowitz-portfolio.html), Kelly is essentially the same as the widely adopted Mean Variance optimization method, except that Kelly also suggests an overall leverage of a portfolio.<br /><br />It is unclear what it means by periods where Kelly "fails". Fails meaning the portfolio is not profitable? But that has nothing to do with Kelly itself. Fails meaning the portfolio underperforms an equal weighted one? Certainly! But again, Kelly does not promise it always outperforms other allocation methods in all periods. It only promises that in the long run, it generates maximum growth rate. The long run, of course, can be very long.<br /><br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-46811520081273823602017-07-11T16:24:53.828-04:002017-07-11T16:24:53.828-04:00Based on all your books it seems that Kelly is the...Based on all your books it seems that Kelly is the ideal allocation method for all trading strategies. Just to confirm, the Kelly formula has flaws when in use, I know you covered the half Kelly but beyond that, have you encountered period where you didn't use Kelly at all and periods where you used Kelly and it failed? Keep in mind I am not referring to the periods where you've recommended QT inventors to opt out of strategies based on regime changes or unknowns. I am aware that this specific does focus on Kelly so we can call it a side note. Ever Garciahttp://www.blogger.com/profile/01357178781354564617noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-31639604784274558092017-07-07T08:30:13.600-04:002017-07-07T08:30:13.600-04:00Hi Emil,
The compound growth rate at any finite T...Hi Emil,<br /><br />The compound growth rate at any finite T asymptotically approaches the formula given in this post (which is exact at T-> infinity). This is true for most theoretical derivations involving time averages in finance.<br /><br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-22994586560565362342017-07-07T05:42:36.765-04:002017-07-07T05:42:36.765-04:00Very interesting, log-utility just happens to maxi...Very interesting, log-utility just happens to maximize the time average which is what we really should be focusing on. But what about the case when we have a fixed time horizon, then taking the limit as T -> infinity does not make sense and we don't get rid of the stochastic component in the growth rate?Emilnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-49181928037315186512017-06-28T07:20:18.623-04:002017-06-28T07:20:18.623-04:00Hi,
ivolatility.com, quandl.com, optionmetrics.com...Hi,<br />ivolatility.com, quandl.com, optionmetrics.com.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-18346100404138009962017-06-28T04:07:49.573-04:002017-06-28T04:07:49.573-04:00Hi Ernie,
Where can we get historical option data...Hi Ernie,<br /><br />Where can we get historical option data (put, call, all strikes and expiry)?<br /><br />Thanks. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-81391515151650787682017-06-26T14:27:00.776-04:002017-06-26T14:27:00.776-04:00Hi,
Certainly if ev is an eigenvector, -ev is one ...Hi,<br />Certainly if ev is an eigenvector, -ev is one too. So you are free to multiply all components by -1. Does that work for you?<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-14021212051507871682017-06-26T13:26:38.043-04:002017-06-26T13:26:38.043-04:00Hi Ernie,
I mean the signs of the eigenvector. Le...Hi Ernie,<br /><br />I mean the signs of the eigenvector. Let's say we have n=4 time series, then for example the first eigenvector may look like [.54 .23 -.55 .90] or [-.54 -.23 .55 -.90]. If one does a PCA on a set of economic time series one might want to preserve the economic interpretation of the first PCA, i.e. the signs matter. So when doing a PCA walk forward, it would be nice to guarantee that the vector "points in the same direction" for each time t. So my question was just whether you have come across a quick code trick for this. One suggestion I've come across is, at each time t, find the largest (in absolute terms) element in EIG(:,1) and make sure this value is positive or negative, depending on which direction one want to rotate the first eigenvector. But I'm not sure this is theoretically correct.<br /> Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-5756413303737400092017-06-25T08:54:36.837-04:002017-06-25T08:54:36.837-04:00Hi,
Thanks for your kind words.
When you said &qu...Hi,<br />Thanks for your kind words.<br /><br />When you said "signs of eigenvectors are not unique" did you mean the sign of their eigenvalues, or the signs of the components of an eigenvector? <br /><br />If the former, that's not possible, since the eigenvalues of a covariance matrix are all >= 0 (the covariance matrix is positive semidefinite.)<br /><br />If the latter, I don't see what's wrong with that. It just means that the hedge portfolio that corresponds to each eigenvector have both long and short positions. You cannot simply ignore the ones with negative values, as that would mean it is no longer an eigenvector of the covariance matrix.<br /><br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-52117320162051311542017-06-25T08:09:53.331-04:002017-06-25T08:09:53.331-04:00Hi Ernie,
Thanks for a great blog and great books...Hi Ernie,<br /><br />Thanks for a great blog and great books. I have a PCA question.<br /><br />As you know, the signs of eigenvectors are not unique. When using for example pcacov in Matlab, the sign can change from time to time. <br /><br />When backtesting, I need to make sure the eigenvectors are pointing in the same direction for each time t. Do you have a quick code trick for how to guarantee this?<br /><br />Thanks Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-82487597264686733192017-06-17T07:30:52.550-04:002017-06-17T07:30:52.550-04:00Hi Kin Wa,
Jensen inequality can certainly explain...Hi Kin Wa,<br />Jensen inequality can certainly explain why E[exp(x)] !=exp(E[x]), but it doesn't give the whole picture.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-67435399183701404392017-06-17T06:04:33.512-04:002017-06-17T06:04:33.512-04:00Hi Ernie,
Is this something can be explained by ...Hi Ernie, <br /><br />Is this something can be explained by the Jensen's inequality?<br /><br />thanks <br /><br />Kin WaKin Wa Funghttp://www.blogger.com/profile/09702606524587040968noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-63654671267056075592017-06-01T15:10:22.738-04:002017-06-01T15:10:22.738-04:00Hi,
Mainly E-minis, but small allocation to agricu...Hi,<br />Mainly E-minis, but small allocation to agricultural and energy futures.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-6238175721671394972017-06-01T15:05:37.181-04:002017-06-01T15:05:37.181-04:00Hi Ernie,
Thank you for quick response.
For Fut...Hi Ernie,<br /><br />Thank you for quick response.<br /><br />For Futures momentum strategy in your pool, what futures do you trade?<br />commodities or stocks index futures? Many thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-82842616073606874152017-06-01T06:49:32.946-04:002017-06-01T06:49:32.946-04:00Hi,
We trade mainly FX mean reversion and Futures ...Hi,<br />We trade mainly FX mean reversion and Futures momentum strategy in our pool. There are a number of other strategies as well that have lower allocations.<br />ErnieErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.com