All Projects → chrism2671 → Pytrendfollow

chrism2671 / Pytrendfollow

Licence: mit
PyTrendFollow - systematic futures trading using trend following

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytrendfollow

Gtrader
a trading strategy trainer, back-tester and bot
Stars: ✭ 71 (-44.09%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Jesse
An advanced crypto trading bot written in Python
Stars: ✭ 1,038 (+717.32%)
Mutual labels:  trading-bot, trading, algorithmic-trading
freqtrade-gym
A customized gym environment for developing and comparing reinforcement learning algorithms in crypto trading.
Stars: ✭ 192 (+51.18%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Socktrader
🚀 Websocket based trading bot for 💰cryptocurrencies 📈
Stars: ✭ 152 (+19.69%)
Mutual labels:  trading-bot, trading, algorithmic-trading
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+78.74%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (+50.39%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Aat
Asynchronous, event-driven algorithmic trading in Python and C++
Stars: ✭ 109 (-14.17%)
Mutual labels:  trading-bot, trading, algorithmic-trading
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (-6.3%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Quant
Codera Quant is a Java framework for algorithmic trading strategies development, execution and backtesting via Interactive Brokers TWS API or other brokers API
Stars: ✭ 104 (-18.11%)
Mutual labels:  trading-bot, trading, algorithmic-trading
sdoosa-algo-trade-python
Algo trade project in python
Stars: ✭ 320 (+151.97%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (+3.94%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Tai
A composable, real time, market data and trade execution toolkit. Built with Elixir, runs on the Erlang virtual machine
Stars: ✭ 264 (+107.87%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+3.94%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Algotrading
Algorithmic trading framework for cryptocurrencies.
Stars: ✭ 249 (+96.06%)
Mutual labels:  trading-bot, trading, algorithmic-trading
quick trade
convenient script for trading with python.
Stars: ✭ 63 (-50.39%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Crypto Signal
Github.com/CryptoSignal - #1 Quant Trading & Technical Analysis Bot - 3,100+ stars, 900+ forks
Stars: ✭ 3,690 (+2805.51%)
Mutual labels:  trading-bot, trading, algorithmic-trading
51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (+123.62%)
Mutual labels:  trading-bot, trading, algorithmic-trading
Trading Bot
Code for automated FX trading
Stars: ✭ 68 (-46.46%)
Mutual labels:  trading-bot, trading
Backtesting.py
🔎 📈 🐍 💰 Backtest trading strategies in Python.
Stars: ✭ 1,124 (+785.04%)
Mutual labels:  trading, algorithmic-trading
Poloniex
Poloniex python API client for humans
Stars: ✭ 71 (-44.09%)
Mutual labels:  trading-bot, trading

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

  1. Quandl
  2. 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.

Trading

For automated trading with Interactive Brokers, install the latest TWS terminal or Gateway. You'll need to enable the API and set it to port 4001.

Code

  1. Python version 3.* is required

  2. Get the code:

    git clone https://github.com/chrism2671/PyTrendFollow.git

    cd PyTrendFollow

  3. Install requirements:

    • install python tkinter (for Linux it's usually present in a distribution repository, e.g. for Ubuntu: apt-get install python3-tk) if necessary.
    • To compile the binary version of arch, you will need the development lirbary for your version of Python. e.g., for Python 3.5 on Ubuntu, use apt-get install libpython3.5-dev.
    • install Python requirements: pip3 install -r requirements.txt
  4. cp config/settings.py.template config/settings.py, update the settings file with your API keys, data path, etc. If you don't use one of the data sources (IB or Quandl), comment the corresponding line in data_sources.

  5. cp config/strategy.py.template config/strategy.py, review and update the strategy parameters if necessary

Usage

Before you start, run the IB TWS terminal or Gateway, go to Edit -> Global configuration -> API -> Settings and make sure that Socket port matches the value of ib_port in your local config/settings.py file (default value is 4001).

  • To download contracts data from IB and Quandl:

    python download.py quandl --concurrent

    python download.py ib

    Use the --concurrent flag only if you have the concurrent downloads feature enabled on Quandl, otherwise you'll hit API requests limit.

  • After the download has completed, make sure the data is valid:

    python validate.py

    The output of this script should be a table showing if the data for each instrument in the portfolio is not corrupted, is up to date and some other useful information.

  • To place your market orders now, update positions and quit:

    python scheduler.py --now --quit

  • To schedule portfolio update for a specific time every day:

    python scheduler.py

For more details on how the system works and how to experiment with it, check out the docs/ directory.

Status, Disclaimers etc

This project is dev status. Use at your own risk. We are looking for contributors and bug fixes.

Only tested on Linux for now, but should work on Windows / MacOS.

Acknowledgements

This project is based heavily on the work of Rob Carver & the PySystemTrade project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].