Saturday, November 30, 2013

Questions about my pairs trading system

Someone emailed me a list of questions, so I thought it would be nice to put the answers into a post for everyone. Original questions are in the block quotes.
I was going through your blog posts and twitter feed and I this you say you do not publish/tweet your algo trading system trades. Does this mean the trades on your twitter feed are from some other manual strategy? What kind of other manual strategies do you apply if you do not mind elaborating or referring me to? 
I do not tweet or publish the algo trades. It would be too easy for someone to start taking away the alpha once they know the pairs and the hedge ratios. The trades that I post are mainly fundamental analysis trades. I have a few posts on the blog explaining my options trades. I basically select companies which I am willing to hold for long periods of time based on solid profitability and bargain prices. Then, I short put options on the company and I am wiling to take ownership if the price drops. Otherwise, I collect the premiums.
Also I understand your system has constant access to live marketdata (1 minute updates?) to make trading decisions. What are the sources of live market data that a retail investor can access? 
I have access to live data with ~250ms delays. This is not hard to obtain. It's not good enough for high frequency trading, but my system is low frequency. Live quotes come with all brokerage accounts as well. I'm using Interactive Brokers, which provides an API to pull the quotes into my code. Many other brokerages provide APIs as well for this. It does not cost any extra money, and very accessible to retail investors.
I was going through the books mentioned on your blog and havn't gotten to the ones in the slides yet (which probably pertain to the next question thats has been perplexing me). I am curious at to how you exploit spreads where 2 stocks in a pair are not linearly correlated. I can see how GLD and IAU from can be linearly related giving you a nice slope factor (beta ?). But going by your example of XOM and BP where you said you can't just put these as a pair because fundamentals may show that only 30% of XOM business is oil while it could be 90% for PB. How does one treat pairs like that? GLD and IAU may be too easy and made for examples but say I wanted to correlate 2 tech stocks. Say MSFT and AAPL who are in the business of making computers/tablets/phones and provide operating systems. Yet these 2 companies have completely different models. These companies cant be straight-up linearly correlated like GLD and IAU. Can MSFT ad AAPL then be fit as a pair on some level? 
The 30% and 90% were just garbage numbers that I used as an example. I stop my research as soon as no relationship is found in order to save time. There are many other pairs that I can research, so I don't try to find ways to force a pair to work. The idea of pairs trading is that one company can be substituted for the other. Most people who like Pepsi will be sufficiently happy to drink Coke. One is a reasonable substitute for each other. MSFT and AAPL are not substitutes for each other and cannot be paired.
I am a software developer at a small prop-trading/brokering firm and have developed a complete OMS with a configurable algo trading engine on a small team in the last few months. This system is backend to manual trading and I understand it well. That is very different from the automated algo trading system you have developed. I am curious as to how you describe your system you have built from a software point of view. Is it a recommender system that compares market data against past learnt heuristics about pairs you have given it to make trade recommendations? I believe you said it can also handle trading state transitions rules. 
My full system contains the order management system, an execution system, a position management system, a backtester, strategy management, and accounting systems. Everything working together allows me to optimize parameters, monitor for trade signals, execute trades, and keep track of orders, positions, and pnl. The strategy management system sends the live data into the loaded strategies. When it's time to execute a trade, desired executions are sent to the execution system. The order and position management systems come into play now too. Some orders get partial fills, which need to be handed properly. The position management system ensures that I don't repeatedly fire trades after I've already been filled.
I hope I am not being too intrusive with my questions. I have been passionately interested in automatic algorithmic trading and have wanted to develop my own system for a while now but didn't really get too far into it. Given my engineering background I always tended towards the technicals, ignoring the fundamentals, and not achieving much success. After the simple case you put forward with your presentation I felt compelled to follow up on my passion, ask questions and learn more. 

Technicals simply do not work. Any success that pops up has been short lived. There are no examples of long lived profitability of technicals outperforming a broad index fund, meaning it is not successful. Profitable does not mean successful. Pairs trading is a form of applied statistics, and still requires a solid understanding of corporate finance if you don't want to end up like Long Term Capital Management. Start with a couple of the recommended textbooks. It will take time to put everything together.

No comments:

Post a Comment