PyTrendFollow - Systematic Futures Trading using Trend Following
Introduction
This program trades futures using a systematic trend following strategy, similar to most managed
futures hedge funds. It produces returns of around ~20% per year, based on a volatility of 25%.
You can read more about trend following in the /docs folder. Start with introduction to trend following. If you just want to play with futures data, see working with prices.
Features
- Integration with Interactive Brokers for fully automated trading.
- Automatic downloading of contract data from Quandl & Interactive Brokers.
- Automatic rolling of futures contracts.
- Trading strategies backtesting on historical data
- Designed to use Jupyter notebook as an R&D environment.
Installation
Data sources
The system supports downloading of price data from
- Quandl
- Interactive Brokers (IB)
It is recommended (though not required) to have data subscriptions for both Quandl and IB.
Quandl has more historical contracts and works well for backtesting,
while IB data is usually updated more frequently and is better for live trading.
To use MySQL as the data storage backend (optional, default is HDF5), you'll need a configured
server with privileges to create databases and tables.