Monday, January 3, 2011

Back test results

Happy New Year to everyone. Now for a little update on the algos and some results that we have from simulations as promised in one of the previous posts.

The snapshot only shows the info for the last date of the simulation. However some of the ratios shown do capture the essence and point us to the industries where we see the most promise for convergence. As seen from our results for the year the performance is not stellar for 2010, however with appropriate leverage, and adjustments to the algos based on the volatility regime shifts one can guarantee better results. There are industries that have posted very good returns on a longer time frame.


Now for some parameter specs used while running the algo. The algo uses daily adjusted closing price from yahoo for US stocks (about 6000 are considered).

Market - US stocks broken by industry. Pairs have to be in the same industry to enter a trade.

Volume - Only stocks with daily and last 20 day average volume greater than 40,000 are considered for this simulation. We ran the simulation for a volume floor of 20K also (which will also be posted). This volume filter should make sure that we are using tradeable companies.

Beta - One year beta to S &P 500 based on daily data is used in calculating the raw beta based on a linear regression. The betas are recomputed for each stock on a daily basis. No mean reversion adjustments are made to the calculated beta (Ex:- Bloomberg uses a mean reversion factor to adjust the raw beta). Stocks with a beta difference of less than 0.2 are used in the sample set for trading (another mechanism to reduce volatility).

Price - Volume criterion should filter low priced stocks. However we do have a low price barrier of $1. The reason for using this low barrier is because we use adjusted closing prices. When you use adjusted closing, even highly liquid stocks can have very low price when we go back 20 years (dividend adjustments and stock splits).

Mean - The average price ratio over 252 days is used in calculating the mean.

Std. Dev - 252 day daily data is used in calculating the std. Dev.

Co-integration test - The test is performed for testing stationarity over a 252 day period for all pairs. A p-val of less than 0.01 is required for a pair to be tradeable.

Std.Dev threshold - A 1.6 Std. Dev move from mean is used as entry criterion for each trade.
Separate simulation with 2 Std. Dev move was also considered.

Profit Limit : Profit limits of 10%, and 5% in separate simulations. Profit limit of complete reversion to mean is being tested right now (will be available later).

Loss Limit : Stop loss limit of 20% with 10% profit limit, and 10% with 5% profit limit are used.

If a pair is entered then it is not repeated the next day until it reverts or until the close out date is reached.

Close Out criteria: 100 days from opening up the trade or when profit or loss limits are hit.

Leverage : Leverage is limited to 300% on a gross basis in most simulations. An unconstrained (high leverage of 20) is also run to keep track of all historic pairs.

Sharpe ratio : We calculate annualized five year and one year Sharpe ratios. We also calculate a 3 month Sharpe ratio (without annualized returns). Risk free rate of 1% is used to calculate the Sharpe ratio.

Trading Cost : Assumed to be $1 per 1000 shares for both entering and exiting a stock.

Capital: Assumed to be $100K at the beginning.

Concentration limit: 6% of capital for each leg of a pair.

Hit ratio: Is calculated as the ratio of profitable pairs over total pairs for a given time frame. We calculate 5 year, 1 year, and 6 month ratios on a rolling basis. A pair is considered profitable if it makes 5% or more at the time of exit.


The summary results as of 12/08/2010 (last day of simulation) are at the bottom of the page. However 5 year Sharpe ratio should give a good idea of where the opportunities lie.

First image (highthreshold) shows results for profit limit of 10%, and second one (lowthreshold) shows results for profit limit of 5%. As we see with lower profit limit per pair we can achieve better Sharpe ratio. Basically that's what we were seeing in 2010. It was a different picture in 2009. A snapshot of 2009 shows the picture is different (reverses). Which takes us to the next important topic of volatility regimes. When the volatility in general is coming down the opportunity starts to shrink, however with better calibration and more trading one can still achieve fairly decent returns.

In our own experience a Sharpe of 0.6 or higher is good. As long as you are in positive territory you are still not losing money although you may not be doing all that well relative to the risk you are taking.

Additional charts and analysis will be provided for some of the industries soon. We have all the data on a daily basis in SQL DB. Just a matter of building a web interface to chart/present the data in a user friendly way. All the pairs info from the time of simulation inception to end date is also stored in the DB. There is scope for further data mining and adding additional conditions for better trading.

Data in xls format can be provided upon request. For some reason blogger doesn't allow me to upload spreadsheets.

1 comment:

  1. Interesting post. Would you mind sharing the xls file? Email is mike212581 at yahoo dot com.
    Thanks.

    ReplyDelete