Skip to main content

quanttrader backtest and live trading library

Project description

quanttrader

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

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.

Installation

Step 1

pip install quanttrader

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

step 2

Download live_engine.py, config_live.yaml, order_per_interval_strategy.py 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
python live_engine.py

Instruments Supported and Example

  • Stock: AMZN STK SMART
  • 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
  • Comdty: XAUUSD CMDTY SMART

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

gui

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.1.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

quanttrader-0.5.1-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

Details for the file quanttrader-0.5.1.tar.gz.

File metadata

  • Download URL: quanttrader-0.5.1.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for quanttrader-0.5.1.tar.gz
Algorithm Hash digest
SHA256 ef6be3cfb34f0044af5caa619245dac0264dca4d749fb31fa4f544c09a286ec0
MD5 9676a6702bc44de8c0bea672350e7cb2
BLAKE2b-256 95501cb22833e27ef989d364853d5eeafba0049689b779d7ab17862f3ea1d5c2

See more details on using hashes here.

File details

Details for the file quanttrader-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: quanttrader-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 79.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for quanttrader-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e03a85550d733abd7377b5bbb542bbde314c4eef88767f0a972e9ec3da9e37b
MD5 64dbf035024914cc88665103cd1723d9
BLAKE2b-256 40bd4719f58ae170f3be8b2fdd1a788464c0f9aa06d42bb390f176e65ddba284

See more details on using hashes here.

Supported by

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