Code Directory
 Visual Basic & VB.NET
New Code
dbForge Studio for PostgreSQL 2.3.212
HTMLPad 2020 16.2
WeBuilder 2020 16.2
Rapid CSS 2020 16.2
Rapid PHP 2020 16.2
C# HTML to PDF 2020.8.1
Vue Injector 3.3
Spectrum Analyzer pro Live 2019
Devart Excel Add-in for HubSpot 2.1
RentALLScript - Airbnb clone 2.2
SuiteCRM Theme Customization 7.11.6
iScripts NetMenus 3.1
iScripts EasyIndex 2.2
iScripts EasySnaps 2.0
Top Code
IcrediBB Bulletin Board System 1.0
Skincare Management System for Scripts 1.4
Sportsbook software by BOOKIE Software 3.01
Readability Analyzer 7.x-1.0-rc2
Betting system 6.x-1.x-dev
Online Betting Exchange & Open API. 1.0
Ninja Playland 1.1
Unix Time Stamp Calculator 1.0
Skincare Management System 1.4
Two Dimensional Random Walk 1.0
shopping mall management system 1.0
Taxi Booking Script 1.0.4
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Rapid CSS 2014 12.3
Top Rated
Uber Clone with Safety Measure Addons 2.0
Answers phpSoftPro 3.12
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Apphitect Airbnb Clone Script 1.0
Deals and Discounts Website Script 1.0.2
Pro MLM 1
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
Classical Pairs Trading Using MatLab 1.0
File ID: 79258

Classical Pairs Trading Using MatLab 1.0
Download Classical Pairs Trading Using MatLab 1.0http://www.mathworks.comReport Error Link
License: Freeware
File Size: 112.6 KB
Downloads: 119
Submit Rating:
Classical Pairs Trading Using MatLab 1.0 Description
Description: This function performs the classical pairs trading framework in a given set of prices

From Wikipedia, the free encyclopedia:
d-deDUThe 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.d-deDt

See also the great book d-deDUDemon of Our Own Designd-deDt 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 coded-deOaos 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

Main references related to the pairs trading strategy are:

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) d-de?Pairs Trading: Performance of a Relative Value Arbitrage Ruled-deOao, Working Paper, Yale School of Management. Available at SSRN:

PERLIN, M. S. (2009) d-de?Evaluation of Pairs Trading Strategy at the Brazilian Financial Marketd-deOao
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:

License: Freeware

Related: maximum, convergence, Updates, periodicity, moving, Window, Finding, threshold, Variable, pairs, Trading, treasury, Frequency, quothigh, references, related, Strategy, Transaction

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 112.6 KB

Downloads: 119

More Similar Code

Files used in the webinar - Algorithmic Trading with MATLAB Products for Financial Applications broadcast on November 18, 2010. This webinar can be viewed at

The download includes an additional demo, not shown in the webinar, that shows how to generate C-code from MATLAB.

Slides, software, and data for the MathWorks webinar, "Using MATLAB to Develop Macroeconomic Models." The file contains a file moneydemo.pdf with slides for the webinar and a collection of MATLAB scripts and helper...

"Dynamical Systems with Applications using MATLAB" covers standard material for an introduction to dynamical systems theory. The text deals with both discrete and continuous systems.

There are applications in mechanical...

Programs from the third edition of 'Advanced Mathematics and Mechanics Applications Using MATLAB', by Howard Wilson, Louis Turcotte and David Halpern, CRC Press, 2003, ISBN 1-58488-262-X. Contains about 12,000 lines of MATLAB programs and...

Read and Write Values from and to the Registry using Matlab.

Contains: source code and documentation.

September 13, 2006

This demo shows a simple program on the video surveilance using MATLAB and some toolboxes.

1. Run in 2 modes --> Monitoring and Playback
2. Users are allowed to change the threshold value and the snap counter for...

Files used in the Webinar "Developing a Financial Market Index Tracker using MATLAB OOP and Genetic Algorithms"

The zip file contains the data and files used to develop an application to track a market index using Genetic...

A Zip file containing the examples that were used in the MathWorks webinar: "Pricing Derivatives Securities using MATLAB".

* Pricing a portfolio of vanilla options using Black-Scholes, a Binomial Tree and...

Update 2011: An example application is included which shows a 2D plot using Matlab formulas. Requires MFC. Visual Studio 2008 is recommended, but the project should work in other versions.

Another update is more correct support for...


User Review for Classical Pairs Trading Using MatLab
- required fields

Please enter text on the image