Category: Algorithmic Trading

Developing a Real Life Fully Automated Trading Algorithm Using Interactive Brokers and Python

In this article I will describe how our backtested algorithm can be used in live algorithmic trading. My broker provides me with the TWS (Trader WorkStation) API which is the solution that I use to build my trading application, obtain market and view account details such as open positions and available cash. The basic idea of […]

This Trading Algorithm Landed Me in the Top 10 on Quantopian

Quantopian is a Boston-based company that aims to create a crowd-sourced hedge fund by letting freelance quantitative analysts develop, test, and use trading algorithms to buy and sell securities. All members can compete against other members in a series of contests called the “Quantopian Open.” Anyone can join the site and enter the contests. Quantopian […]

Pair Trading GLD and GDX

When the correlation between the two securities temporarily weakens, i.e. one stock moves up while the other moves down, the pairs trade would be to short the outperforming stock and to long the underperforming one, betting that the “spread” between the two would eventually converge. The divergence within a pair can be caused by temporary […]

Testing for Cointegration of GLD and GDX for use in a Pair Trading Strategy

In this research I am going to test whether the price series of two securities GLD (Gold Price) and GDX (Gold Miners Equity ETF) are cointegrated. This is crucial if we want to develop a pair trading strategy around those two securities. I want to test if the spread between the two series is stationary […]