Skip to main content

quanttrader backtest and live trading library

Project description


Welcome to quanttrader, a pure python-based event-driven backtest and live trading package for quant traders.

The source code is completely open-sourced here on GitHub. The package is published here on pypi and is ready to be pip installed. The document is hosted here on readthedocs.

In most cases, a backtest strategy can be directly used for live trade by simply switching to live brokerage. A control window is provided to monitor live trading sessions for each strategy separately and the portfolio as a whole.


Backtest code structure

Backtests examples

Live trading

Live Trading demo video

Live Trading code structure

Prerequisite: download and install IB TWS or IB Gateway; enable API connection as described here.


Step 1

pip install quanttrader

Alternatively, download or git the source code and include unzipped path in PYTHONPATH environment variable.

step 2

Download, config_live.yaml, by clicking Raw button, right clicking save as, and then change the file extension to .py or .yaml.

step 3

cd where_the_files_are_saved

Instruments Supported and Example

  • Foreign Exchange: EURGBP CASH IDEALPRO
  • Futures: ESM9 FUT GLOBEX
  • Options on Stock: AAPL OPT 20201016 128.75 C SMART
  • Options on Futures: ES FOP 20200911 3450 C 50 GLOBEX

Order Type Supported

Basic order types. See IB Doc for details.

  • Auction
  • Auction Limit
  • Market
  • Market If Touched
  • Market On Close
  • Market On Open
  • Market to Limit
  • Limit Order
  • Limit if Touched
  • Limit on Close
  • Limit on Open
  • Stop
  • Stop Limit
  • Trailing Stop
  • Trailing Stop Limit


DISCLAIMER Open source, free to use, free to contribute, use at own risk. No promise of future profits nor responsibility of future loses.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quanttrader-0.5.3.tar.gz (58.5 kB view hashes)

Uploaded Source

Built Distribution

quanttrader-0.5.3-py3-none-any.whl (82.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page