Trading Using Statistical Arbitrage vs. Traditional Technical Analysis

This is a discussion on Trading Using Statistical Arbitrage vs. Traditional Technical Analysis within the Technical Analysis forums, part of the Methods category; Originally Posted by surfeur Thanks IFeelFree for your feedback. How many bars you use for find your cointegration ? 2500 ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Dec 20, 2015, 8:56pm   #9
Joined Oct 2015
IFeelFree started this thread
Quote:
Originally Posted by surfeur View Post
Thanks IFeelFree for your feedback.

How many bars you use for find your cointegration ? 2500 5000? more?

So if i understand right, you don't use the weight found with johansen procedure but you use kalman filter ?

If Yes there are differences ? the weight of johansen isn't enough good?
I'm using 5 years of weekly data, so 5 x 52 = 260 data points. I also have a daily version of the software which uses 5 x 252 = 1260 data points. However, the returns of the daily version are just slightly higher than the returns of the weekly version, but it has higher transaction fees, and also would make a lot more demands on my personal time, so I'm using the weekly version.

I take the weights from the Johansen procedure and I use them as the initial values (the "seed" values) for the Kalman filter. (It turns out the Kalman filter is sensitive to initial values, so this is important.) The advantage of the Kalman filter is that it gives the statistically optimal weights for each period, rather than just a constant weighting. It is more dynamic, and seems to better accommodate changing market conditions. The bottom line is that it dramatically improves the performance of the algorithm. That's why I'm getting >50% AYR.

You can read examples in Chan's book. For example, using a triplet of cointegrated ETFs, EWA-EWC-IGE, he obtains only a 12.6% average yearly return (AYR) using the Johansen weights with a simple mean-reversion algorithm. However, adding a Kalman filter to the simpler EWA-EWC cointegrated pair, he obtains the much higher 26.2% AYR. I know most people prefer to keep things simple, but sometimes a more sophisticated algorithm really does perform better.
IFeelFree is offline   Reply With Quote
Old Dec 20, 2015, 9:35pm   #10
NVP
 
NVP's Avatar
Joined Jun 2004
Prices are not random under specific conditions.....if you know The conditions to look for and can execute the trades at that time you will always make money trading
NVP is offline Coach/Trainer   Reply With Quote
Old Dec 20, 2015, 9:38pm   #11
NVP
 
NVP's Avatar
Joined Jun 2004
Quote:
Originally Posted by IFeelFree View Post
Thanks, Mr. Charts. I suspect that my approach is bit too mathematical for most traders, but the math gives me confidence that I have a sound basis for making my trades. There's at least one other trader on this forum who's also using a cointegration/mean-reversion strategy. I'm looking at other strategies as well, such as cointegrated vector autoregressive models and momentum strategies. As long as I'm making good returns, I'm going to continue with this.
That's the secret to being a trader .....be confident in your edge .....

Respect
N
NVP is offline Coach/Trainer   Reply With Quote
Old Dec 21, 2015, 12:10am   #12
Joined Oct 2015
IFeelFree started this thread
Quote:
Originally Posted by NVP View Post
Prices are not random under specific conditions.....if you know The conditions to look for and can execute the trades at that time you will always make money trading
It's not that prices are random. It's that our knowledge of the causes of price movements are limited. (I can't predict price movements with perfect accuracy.) Therefore, any price movements I can't predict are random to me.

Presumably, all price movements have causal mechanisms, but we can't know all of them. What we can't explain is "random".
IFeelFree is offline   Reply With Quote
Old Aug 2, 2016, 7:57pm   #13
 
mcquak's Avatar
 
2 Posts
Joined Aug 2014
Hi IFeelFree,
did you perform any cointegration testing over FX spot pairs? The main issue with ETFs is data hovewer FX data are quite easily within reach

Thanks!

Tomas

Quote:
Originally Posted by IFeelFree View Post
The problem with traditional technical analysis is that most financial time series (such as stock prices) are pretty close to being a "random walk". The "random walk hypothesis" states that stock market prices evolve according to a random walk and thus cannot be predicted. (This is consistent with the "efficient market hypothesis.") However, stock prices are not a pure random walk. For one thing, there is usually a small deterministic (predictable) component. The implication here is that much of technical analysis is an effort to detect a small deterministic trend within a larger random process. This large random component means that conventional technical analysis often doesn't work all that well.

There is some evidence that certain asset classes, such as currencies and commodities, tend to be mean-reverting, in which case I would expect traditional technical analysis to work somewhat better for these assets. Even so, there is a large random component to these asset prices that make them difficult to forecast. To address the randomness problem, some quantitative analysts use statistical arbitrage, in particular, cointegration. Cointegration involves assembling a portfolio of securities that has favorable statistical properties for forecasting. The idea is that you try to find a combination of 2 or more securities in which the random walk components largely cancel out, and you’re left with a portfolio that is more deterministic.

The most common example of this is pair trading. Pair trading is a market-neutral trading strategy that monitors the prices of two correlated securities, such as, say, Coca-Cola (KO) and Pepsi (PEP). Because these companies sell similar products, their stocks tend to move together. In pair trading you buy one and short the other (in the correct ratio) when their prices diverge significantly (based on historical norms). However, the problem with pair trading is that in recent years it has become too popular. As we know, when too many people are using the same or similar strategy, its effectiveness diminishes. To put it bluntly, it appears that pair trading is dead.

However, there’s no reason to limit cointegration to two securities. Statistical methods such as the Johansen procedure allow one to find cointegrated portfolios of 3 or more securities. The rapid growth in the number of ETFs in recent years adds a large number of potential securities with which to assemble a cointegrated portfolio. The possible number of cointegrated portfolios of 3 or more ETFs is so large that it is unlikely to be fully exhausted for the foreseeable future. (For example, I calculate 1.2 billion possible combinations of 3 ETFs. Even if only a small fraction of these exhibit cointegration, that is still likely to be a large number. The number of possible combinations of 4 or 5 ETFs is astronomical.)

There are commercial software packages (such as FX AlgoTrader) which enable users to find and trade cointegrated pairs, but I’m not aware of any commercial products that enable users to assemble cointegrated portfolios of 3 or more securities. For anyone who has software programming skills, there are resources available to do this. (For example, Ernie Chan’s “Algorithmic Trading: Winning Strategies and Their Rationale” provides a good overview, is practical and not overly technical.) As a software engineer, I wrote my own software to find and trade cointegrated portfolios of multiple (3 or more) securities. Currently, I’m trading a cointegrated portfolio of 3 ETFs, and so far, I’m having good results. I did paper trading for nearly a year while I developed and refined the algorithm, but I recently “went live”. Backtesting suggests I should be able to achieve greater than 50% average yearly return (AYR), with a maximum drawdown of 13%. Since I starting live trading in a $100,000 account 2 1/2 months ago I’ve made an 11.3% return during this period. (If the algorithm continues to perform this well, this suggests an AYR of 67%.) Time will tell how well the algorithm continues to perform.

To implement a mean reversion strategy, I apply a Kalman filter to the cointegrated portfolio. This provides optimal dynamic updating of the portfolio weights, along with error and variances of the “spread”. (This is similar to a Bollinger Band approach, but without the lag inherent in moving averages and moving standard deviations.) The following chart shows 5 years of weekly data of the spread “error” (blue line), along with +/- the square-root of the spread variance (green/red lines). When the spread error is above the green line, I short the portfolio. When it’s below the red line, I buy:

Attachment 202404

The cumulative returns during 4 years of backtesting produced an in-sample AYR of 67%:

Attachment 202406

If this thread generates any interest, I’ll try to post regularly to report on the algorithm performance, answer questions, and discuss other trading strategies I’m looking at, such as using multivariate auto-regressive models.

P.S. If anyone can tell me how to make the chart images larger, I'd appreciate it!
mcquak is offline   Reply With Quote
Old Mar 28, 2017, 9:31pm   #14
 
3 Posts
Joined Mar 2017
Autoregressive models

Hello Feel Free

I am glad you mentioned autoregressive models. I have been wondering if using any AR or ARMA models have any predictable capabilities on the stock market.

Have you used any of these?


I have only applied these models for academic purposes, therefore I was wondering if you could provide any feedback on their practicality or feasibility in trading.



regards
JDel is offline   Reply With Quote
Old Aug 6, 2017, 10:42pm   #15
Joined Aug 2017
So would you all say the mean reversion applies mainly if you trade fx cause I do know 1 guy that does this with FX but he has a very large capital base.

Not sure if this would work on individual stocks or indecies ?
wisefoolx is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statistical Arbitrage resources hirtop General Trading Chat 1 Oct 3, 2015 7:16pm
Statistical Arbitrage trading/market neutral strategies hirtop General Trading Chat 2 Oct 3, 2015 7:04pm
Is there any good statistical data on Technical Analysis Patterns? watkins Technical Analysis 5 Mar 22, 2013 1:12pm
Statistical Arbitrage? yari123 Discretionary Trading 2 Aug 2, 2007 3:51pm
Statistical Arbitrage ducati998 Trading Systems 1 Dec 29, 2004 3:18am

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)