Coder Social home page Coder Social logo

statistical-arbitrage-using-pairs-trading's Introduction

#Statistical Arbitrage using Pairs Trading

By Jayesh Kurup

History of Statistical Arbitrage:

This strategy was first developed and used in the mid 1980s by Nunzio Tartaglia’s quantitative group at Morgan Stanly.

This is a mean reverting strategy to harness to behavior of similar securities

What is Pairs Trading:

Statistical arbitrage trading or pairs trading as it is commonly known is defined as trading one financial instrument or a basket of financial instruments.

The co-integrated pairs are usually mean reverting in nature viz after deviating from the mean, they tend to revert back at some point.

The farther the difference from the mean, greater is the probability of a reversal.

Note however that statistical arbitrage is not a risk free strategy. For example one of the position taken for a pair, may pick up a trend than reverting back to the mean. We should hence define strickt thresholds to ascertain we dont incur tremendous loss.

The Concept:

Step 1: Find two securities that are in the same sector / industry, similar market capitalization and average volume traded is preffered. (Eg. Master Card (MA)/ Visa(V) )

Step 2: Calculate the spread, I have used the pair ratio to indicate the spread. It is simply the log of price of security A / price security B.

Step 3: Calculate the mean, standard deviation, and z-score of the pair ratio / spread and define strict thresholds for entry/exit

Step 4: Ensure securities are co integrated. I have used the Augmented Dicky Fuller Test (ADF Test) to test for co-integration. The test has to reject the null hypothesis that the pair is not co-integrated.

Step 5: Generate trading signals Trading signals are based on the z-score. In the project I have used a z-score of 2 and Stop Loss at 3, Take Profit at 0.5 (This can be varied and suited as per choice, see What If analysis in Excel for best combination)

Step 6: Process transactions based on signals

Step 7: Reporting

statistical-arbitrage-using-pairs-trading's People

Contributors

kurupjayesh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.