tag:blogger.com,1999:blog-35364652.post785550411785053767..comments2024-04-22T13:29:20.051-04:00Comments on Quantitative Trading: What worked in 2011?Ernie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-35364652.post-92186954053697742412012-04-11T17:30:59.896-04:002012-04-11T17:30:59.896-04:00Anon,
It is true that my data has survivorship bia...Anon,<br />It is true that my data has survivorship bias. But hopefully a one-year backtest won't be affected by that too much.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-29521849684541252782012-04-11T13:46:24.791-04:002012-04-11T13:46:24.791-04:00Ernie,
when you use SP500 to backtest your strateg...Ernie,<br />when you use SP500 to backtest your strategies, how do you eliminate survivor's bias? because the SP500 companies you got in early 2012 are different from those at the beginning of 2011<br />thanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-63542349279795184952012-02-15T17:26:51.553-05:002012-02-15T17:26:51.553-05:00Hi Anon,
I heard http://www.fxhistoricaldata.com p...Hi Anon,<br />I heard http://www.fxhistoricaldata.com provides free data.<br />You can also purchase from fxtickdata.com.<br />In fact, you can download 1 year's worth of intraday data free from Interactive Brokers if you are a customer. <br />The best data is that which come from your own broker, because FX has no centralized consolidated quote stream.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-44073083081786379652012-02-15T15:54:27.184-05:002012-02-15T15:54:27.184-05:00Hi Erine
Could you please kindly recommend any so...Hi Erine<br /><br />Could you please kindly recommend any source of reliable fx tick data,the only source I can get it for free is from gain capital, but i don't know how good is the quality, and its file format is not consistent<br /><br />http://ratedata.gaincapital.com/<br /><br />I heard onetick.com, but it seems to me it is more meant for institution investor rather than retail investor? How expensive of purchasing FX tick data from Reuters? <br /><br />Thank YouAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-85659141023488028742012-02-15T14:27:20.457-05:002012-02-15T14:27:20.457-05:00Hi anon,
No, I haven't applied HMM to FX. I tr...Hi anon,<br />No, I haven't applied HMM to FX. I tried the technique on futures data before, but find that because there are so many parameters to optimize, it overfitted the data.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-38076788651020098682012-02-15T13:35:12.529-05:002012-02-15T13:35:12.529-05:00Hi Erine
Have you ever applied Hidden Markov Chai...Hi Erine<br /><br />Have you ever applied Hidden Markov Chain technique on FX trading? Any good practical resource you can recommend ?<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-35150768874208567162012-02-13T16:21:32.349-05:002012-02-13T16:21:32.349-05:00Anon,
The currency funds info can be found at http...Anon,<br />The currency funds info can be found at http://www.efinancialnews.com/story/2012-01-25/currency-funds-face-investor-ire<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-19141730867655060592012-02-13T16:07:52.282-05:002012-02-13T16:07:52.282-05:00Hi Ernie
You mentioned in your article " 71 ...Hi Ernie<br /><br />You mentioned in your article " 71 out of 77 Forex funds tracked by a Citigroup currency analyst were down in 2011" <br /><br />Where I can find this information online? <br /><br />ThxAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-68242122019799457012012-02-09T20:52:44.955-05:002012-02-09T20:52:44.955-05:00Hi Ernie,
Thanks for your response. will check ou...Hi Ernie,<br /><br />Thanks for your response. will check out interactive brokers.<br /><br />I had TEPCO on before the tsunami. Earthquakes did happen before but the blow-up of the pairs wasnt that bad the previous time.<br /><br />After the tsunami i cut all power companies out in japan.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-62717167243899248842012-02-09T17:20:29.426-05:002012-02-09T17:20:29.426-05:00Leigh,
no, I do not want to look at monte carlo ...Leigh, <br /><br />no, I do not want to look at monte carlo at all, variance reduction or not. It would be just way to slow. same for finite differences.<br /><br />But what I have found is this:<br /><br />ftp://ftp.math.ethz.ch/risklab/papers/den_ou.pdf<br /><br />and this <br /><br />http://statistik.ets.kit.edu/download/doc_secure1/ptem342v144techreport.pdf<br /><br />which uses the first result.<br />I'll try to use this approach.<br /><br />Ernie,<br /><br />I understand what you say about stop losses being unnecessary for true mean reversion strategies. Unfortunately I cannot be sure my portfolios are true mean reverting portfolios. I use these results:<br /><br />http://arxiv.org/abs/0708.3048<br /><br />to search for 'least stationary' linear dependencies between two or three FX pairs for the timeframe several minutes to couple of hours. They are not guaranteed to be or remain mean-reverting. So I must have some idea when to stop and move on to next trade.Alexeynoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-87355193096467627352012-02-09T11:52:20.383-05:002012-02-09T11:52:20.383-05:00Hi Anon,
Good to hear that pair trading stocks con...Hi Anon,<br />Good to hear that pair trading stocks continues to be profitable in Asia!<br /><br />Would you buy a stock like TEPCO even after fundamentally bad news? Are you not afraid that the fundamental news affected the fundamental valuation of a company so that the price moves to a new equilibrium price and not likely to revert to its previous equilibrium?<br /><br />Incidentally, Andrew Lo specifically used this mean-reverting strategy to illustrate the "crowd trading" effect you alluded to. I have also elaborated on the connection between mean-reversion, "contagion effect", and Kelly formula in my book, using this same strategy.<br /><br />Interactive Brokers provided both stock loans and margin to me currently. Previously, I used Lime Brokerage, with Goldman Sachs as the stock loan and margin provider. I heard, however, that Fidelity Prime Brokerage has the best stock loan availability. (I mention Lime, Goldman, and Fidelity because I use them for my fund, not for personal trading.)<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-17811164943085142022012-02-09T11:12:19.959-05:002012-02-09T11:12:19.959-05:00Hi Ernie,
Must say a good blog. Well for mean re...Hi Ernie, <br /><br />Must say a good blog. Well for mean reversion strategies, one of the tthings to be careful is the fact that most of the funds/traders are probably looking at the same pairs, thus it produces a "crowded trade" effect. So when things get ugly, you'll see that everyone will be on the same side unwinding...and on the upside, you'll need to have more leverage to make the "returns" look attractive. If you can backtest your strategy inclusive of transaction cost and still get great unlevered returns (+10%), then probably you can conclude in some certainty that it is not a "crowded portfolio".<br /><br />I have basically traded mean reverting pairs in Asia Pacific. have not done so in EU or US. But i can confirm that 2008 was indeed a fabulous year.If i have stuck to the model, i would have made circa 35-45% unlevered, but as i did not have the guts to go for it, i manually put on trades less than 50% of what the model said, it was like close to +15% for me. First half of 2009 was good as well. Returns in 2010 and 2011 was positive but low single digits.<br /><br />The tsunami in Japan did increased the volatility thus mean reverting pairs actually booked a very profitable 6-7 months after the tsunami. However if you are long TEPCO it would have hurt. (which incidentally i did..and shorted another power company)..however this is a random event as it could have happened to a power company that i have shorted and could have made tonnes of money on it.<br /><br />I have recently moved out of the place i was working at. i have a question ernie, (if i understand correctly that you are trading on your own now)<br /><br />which brokers are you going through to get borrows to short and also provides competitive brokerage fees? anyone that provides leverage for you?<br /><br /><br />I am thinking of possibly trading on my own, however, not with a substantial capital. Circo 300k to start with. Possibly levered 3-4 times.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-3606547929993053862012-02-09T07:53:02.852-05:002012-02-09T07:53:02.852-05:00Sink,
You can consider as many markets as you like...Sink,<br />You can consider as many markets as you like, but when you find good results in pairs of markets that make no fundamental sense, you have to make sure that the results are not spurious (e.g. due to some coincident market events that may not repeat).<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-57762260752256257042012-02-08T22:31:46.325-05:002012-02-08T22:31:46.325-05:00Ernie, thanks for the quick response. How many ma...Ernie, thanks for the quick response. How many markets should I consider testing? Should they be related, or should they be unrelated? For example, (EWC, EWA) being related, (EWH, FXI) too. (SPY, TLT, IYR) are more or less not correlated? <br /><br />Thanks,<br /><br />SinkAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-89978876205888404092012-02-08T18:27:40.870-05:002012-02-08T18:27:40.870-05:00Hi Sink,
I recommend against optimizing your param...Hi Sink,<br />I recommend against optimizing your parameters for each specific market, since the limited historical data can easily lead to data snooping bias. One set of parameters should work for all markets, even though they may not be optimal for some.<br /><br />Whenever a drawdown is steeper than the max drawdown in backtest, or a drawdown duration is longer than the max drawdown duration, it is time to study the model again to see what whether we have overlooked some weakness.<br /><br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-14536950207075449652012-02-08T16:04:13.111-05:002012-02-08T16:04:13.111-05:00Hi, Erine, I am a new to your web site and new to ...Hi, Erine, I am a new to your web site and new to quantitative trading (I have not started). I have a couple questions I can't find answer anywhere and hope that you could point me to some resource?<br /><br />First question is when you mentioned optimization, do you optimize your system against just one specific market? I backtested my 'system' against 30 common ETFs, SPY, GLD, EW*, XL*, and etc. Some 'system' do okay/well in 80% of the markets and small damage to the remaining markets; some 'system' result wide range of numbers. Does that matter? <br /><br />My second question is how often you retest your system? I mean market regime changes, market move faster/slower and need new ema period, and etc? Do you wait until lost pile up? What trigger a retest? What trigger a 'back-to-the-drawing-board' event?<br /><br />Thanks,<br /><br />SinkAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-8929479291516111802012-02-08T07:21:47.510-05:002012-02-08T07:21:47.510-05:00R.D.,
Yes, we also found from our equity reversal ...R.D.,<br />Yes, we also found from our equity reversal strategies that they mostly make money on a few highly volatile days. That's why the H2 of 2010 - H1 of 2011 weren't good times for those strategies.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-10668712085449040182012-02-07T15:07:43.860-05:002012-02-07T15:07:43.860-05:00I did a similar mean reversion backtest. Over 500...I did a similar mean reversion backtest. Over 500 stocks, normalized for price and volume, both absolute value and standard deviation. Looking at zones of price and volume on day n to predict what would happen on day n+1. Winning (long)trades have a modest to large negative delta price with a modest volume. Enter with a limit order, typically down from the previous close by about 1%, exit at the close. At first it looked great, lots of winning trades, excelent per trade expectancy, etc. Then I looked at the equity curve and found most of the good trades were on the same few days throughout the year. You can salvage the strategy to some degree by only taking trades when more than 10% of the stocks in the model give a buy signal, but it's hard to make much money when there are only a few days like that. The good news is it has lots of carrying capacity on those few days.R.D.https://www.blogger.com/profile/13472028365958293916noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-8900720334605438922012-02-04T09:01:49.912-05:002012-02-04T09:01:49.912-05:00Alexey,
I have never found that imposing a stoplos...Alexey,<br />I have never found that imposing a stoploss in the backtest of a mean-reverting strategy is helpful to its returns or Sharpe. Have you found otherwise? (See also my discussion here: http://epchan.blogspot.com/2011/09/stop-loss-profit-cap-survivorship-bias.html)<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-20367344915880255842012-02-03T15:32:23.833-05:002012-02-03T15:32:23.833-05:00Alexey,
As far as your comment:
"It would...Alexey, <br /><br />As far as your comment: <br />"It would be interesting to know if there is an analytic formula, like BS, in this case, or at least good analytic approximation. This will make it possible to maximize the value of the option by placing strike and barrier accordingly. ...I have an idea as to how to price that option using monte-carlo (as we know the distribution of the spread if it follows OU) but this approach is waaaaaay to slow to be used in optimization."<br /><br />Have you tried variance reduction techniques and low discrepany sequences? How about finite difference methods?Thorp wanna behttps://www.blogger.com/profile/13157387719787901521noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-67182033028739543402012-02-03T14:12:38.375-05:002012-02-03T14:12:38.375-05:00Sorry, meant for anonymous and Alexey... Need to c...Sorry, meant for anonymous and Alexey... Need to check my commentsThorp wanna behttps://www.blogger.com/profile/13157387719787901521noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-90005932997769792852012-02-03T14:08:55.501-05:002012-02-03T14:08:55.501-05:00Howard and James,
Killing 2 birds with one stone ...Howard and James,<br /><br />Killing 2 birds with one stone (cointegration of symbols and learning MATLAB)... <br /><br />Meucci tests cointegration on swaps in this paper: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905<br />Also, the matlab code and data can be found here: http://www.mathworks.com/matlabcentral/fileexchange/24120-review-of-statistical-arbitrage-cointegration-and-multivariate-ornstein-uhlenbeck <br /><br />That way you can figure out which symbols cointegrate and learn MATLAB at the same time. Just don't steal all of the alpha...Thorp wanna behttps://www.blogger.com/profile/13157387719787901521noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-39001945081307876002012-02-03T07:58:15.710-05:002012-02-03T07:58:15.710-05:00Alexey,
Whether a strategy does well is more of a ...Alexey,<br />Whether a strategy does well is more of a question of whether volatility is fairly constant, or whether it changes a lot. If it is fairly constant, you can always adapt your "Bollinger bands" to that volatility and be profitable. Alternately, you can also do that if you are very good at predicting volatility.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-73364536373855498752012-02-03T07:55:22.560-05:002012-02-03T07:55:22.560-05:00Ernie,
I have a question for you. And actually an...Ernie,<br /><br />I have a question for you. And actually anyone else trading mean-reversion. Let's say you have found stationary-looking portfolio. You can estimate it's OU parameters [mean, sigma, reversion speed]. So you see how far it is now from the mean. This gives you an idea as to whether short it or go long. Now my question is: where to put stop loss and take profit targets. Did anyone try to estimate it scientifically?<br /><br />I am thinking along the following lines... What we have here is an option. If we put on a trade with stop loss and take profit and some time target after which we close it down (if it did not hit SL or TP.) This is a barrier american option. The strike is TP, the barrier is SL and the expiration is our time horizon.<br /><br />So if we believe in our mean-reversion model and the parameters that we estimated for it then the only thing we need to do is to price that American Barrier option on that particular Ornstein-Uhlenbeck model.<br /><br />Did anyone do it like this? It would be interesting to know if there is an analytic formula, like BS, in this case, or at least good analytic approximation. This will make it possible to maximize the value of the option by placing strike and barrier accordingly.<br /><br />I have an idea as to how to price that option using monte-carlo (as we know the distribution of the spread if it follows OU) but this approach is waaaaaay to slow to be used in optimization.<br /><br />Any ideas?Alexeynoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-4569482218791630512012-02-03T07:53:14.866-05:002012-02-03T07:53:14.866-05:00James,
When we run statarb strategies, we have new...James,<br />When we run statarb strategies, we have news alerts on stocks that we have orders or positions on. We manually check each news item to see if we should cancel the order or exit the position immediately. <br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.com