Pair trading indices: shorting the AEX

Pair trading
Pair trading

I am Dutch and I know from first hand experience that the Dutch economy is an open economy. When world trade slows down this immediately effects the Dutch stock exchange. Although this sounds like a bad thing, I figured this could also be used as a sort of counter balance in a pair trading strategy.

Below are some graphs of my exploration of this idea.
The idea is to sell short on the AEX index and buy different other indices.

Short: blue line
Long: green line
Difference: red line

Continue reading “Pair trading indices: shorting the AEX”

Exploring pair trading opportunities with yahoo, python and LibreOffice

I have been reading two books about quantitative and algorithmic trading by Ernie Chan:

  • Quantitative Trading: How to Build Your Own…
  • Algorithmic Trading: Winning Strategies and…

See the books page for my reading recommendations.

One of the main take aways of this reading is the insight that it is possible to create stationary pairs by shorting and longing two, or more equities that usually move in tandem. The idea is to arbitrage the oscillating differences in moves between the equities in the pairs. Mr Chan explains all the mathematics behind mean reversion and provides Matlab code do the necessary calculus.
My approach to exploring this idea and the possibilities is far simpler and less elegant. Still, I think some might find it useful to see my take on it. I wrote a python script that pulls daily data from Yahoo and then calculates the ratios between two equities. With the resulting ratios data I continued my investigations in LibreOffice Calc. I like to use Calc to model my ideas and as they become more complicated or as I want to test more data sets I move the model over to code using Python and the pandas library.

Continue reading “Exploring pair trading opportunities with yahoo, python and LibreOffice”