Matlab Code‎ > ‎
Classical Pairs Trading Using Matlab

Description:

This function performs the classical pairs trading framework in a given set of prices
 
From Wikipedia, the free encyclopedia:
“The pairs trade was developed in the late 1980s by quantitative analysts and pioneered by Gerald Bamberger while at Morgan Stanley. With the help of others at Morgan Stanley at the time, including Nunzio Tartaglia, Bamberger found that certain securities, often competitors in the same sector, were correlated in their day-to-day price movements. When the correlation broke down, i.e. one stock traded up while the other traded down, they would sell the outperforming stock and buy the underperforming one, betting that the "spread" between the two would eventually converge.”

Source: http://en.wikipedia.org/wiki/Pairs_trade#Algorithmic_pairs_trading 
See also the great book “Demon of Our Own Design” by Richard Bookstaber, which provides an interesting background for the pairs trading strategy.

There are many ways you can implement the pairs trading framework. For this package, I used a very simple set of rules. Details can be found within code’s comments.

Please note that this package has been developed over the years and it will no longer exactly replicate the results from my 2007 paper.

Qualities of the package:
- Handles any number of assets
- Outputs separately the plot for the total cumulative profit from the long, short and combined positions.
- Outputs all trades, including traded prices and time of trades.
- Provides the user a large amount of input choices for the pairs trading algorithm, including:
* amount of money to put in each position (long and short)
* value of transaction cost (in money unit)
* size of moving window for finding the pairs over the price data
* periodicity of pairs updates
* maximum number of days to keep any trade (without convergence).
* value of threshold variable
 

References:

 
NATH, P. (2003) "High Frequency Pairs Trading with U.S. Treasury Securities: Risks and Rewards for Hedge Funds", Working Paper, London Business School.

GATEV, E., GOETZMANN, W. N., ROUWENHORST, K. G. (1999) ‘Pairs Trading: Performance of a Relative Value Arbitrage Rule’, Working Paper, Yale School of Management. Available at SSRN: http://ssrn.com/abstract=141615.
 
PERLIN, M. S. (2009) ‘Evaluation of Pairs Trading Strategy at the Brazilian Financial Market’
Journal of Derivatives & Hedge Funds, V. 15, N. 2, pp. 122-136.

PERLIN, M. S. (2007b) "M of a Kind: A Multivariate Approach at Pairs Trading". Working Paper. available at SSRN: http://ssrn.com/abstract=952782.

ċ
Marcelo Perlin,
Jan 6, 2015, 11:52 AM
评论
您没有权限添加评论。