Home

Awesome

Purpose

A simple trading equity trading model on Interactive Brokers' API dealing with (pseudo) high-frequency data studies.

Requirements

What's new

14 Jun 2019

- Merged pull request from: https://github.com/chicago-joe/IB_PairsTrading_Algo

Special Thanks to chicago-joe for updating to work with Python 3.

19 Jun 2019

Setting up

Running on a local Python console

Steps to run the trading model on your command line:

Running from a Docker container

This step is optional. You can choose to deploy one or several instances of these algos on a remote machine for execution using Docker.

A Docker container helps to automatically build your running environment and isolate changes, all in just a few simple commands!

To run this trading model in headless mode:

Key concepts

At the present moment, this model utilizes statistical arbitrage incorporating these methodologies:

Other functions:

And greatly inspired by these papers:

And book:

Step-by-step guide to more trading models

<a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-python-finance-second-edition?utm_source=github&utm_medium=repository&utm_campaign=9781789346466"><img src="https://www.packtpub.com/media/catalog/product/cache/e4d64343b1bc593f1c5348fe05efa4a6/b/1/b11165.png" alt="Mastering Python for Finance - Second Edition" height="256px" align="right"></a>

I published a book titled 'Mastering Python for Finance - Second Edition', discussing additional algorithmic trading ideas, statistical analysis, machine learning and deep learning, which you might find it useful. It is available on major sales channels including Amazon, Safari Online and Barnes & Noble, in paperback, Kindle and ebook. Get it from:

Source codes and table of contents on GitHub:

Topics covered with source codes:

If you would like a FREE review copy, drop me an email at jamesmawm@gmail.com.

Suggested enhancements

Some ideas that you can extend this model for better results:

Disclaimer

Is this HFT?

Sure, I had some questions "how is this high-frequency" or "not for UHFT" or "this is not front-running". Let's take a closer look at these definitions:

This models aims to incorporate the above two functions and present a simplistic view to traders who wish to automate their trades, get started in Python trading or use a free trading platform.

Other software of interest

I write software in my free time. One of them for trading futures was simply called 'The Gateway'. It is a C# application that exposes a socket and public API method calls for interfacing Python with futures markets including CME, CBOT, NYSE, Eurex and ICE. Targets the T4 API.

More information on GitHub: https://github.com/hftstrat/The-Gateway-code-samples or view on the <a href="https://scctrader.herodevice.com/the-gateway/">website</a>.

Final notes