A backtester and live trader for financial algorithms. [VK branch]


License
Apache-2.0
Install
pip install zipline-live2-vk==1.3.0.7.0.18

Documentation

zipline-live

zipline-live2 is now continued under https://github.com/shlomikushchi/zipline-trader

zipline-live2

Welcome to zipline-live2, the on-premise trading platform built on top of Quantopian's zipline.

zipline-live2 is based on the zipline-live project.

zipline-live2 is designed to be an extensible, drop-in replacement for zipline with multiple brokerage support to enable on premise trading of zipline algorithms.

we recommend using python 3.6+ but python 2.7 is also supported.

Installation

use a fresh virtual env

pip install virtualenv
virtualenv venv
activate:
    Mac OS / Linux
        source venv/bin/activate
    Windows
        venv\Scripts\activate

installing the package:

pip install zipline-live2
zipline-live

for advanced capabilities recommended way to use this package with docker using this command:

docker build -t quantopian/zipline .

(if your algo requires more packages, you could extend the dockerfile-dev and install using: docker build -f dockerfile-dev-t quantopian/zipline .)

you could run everything on a local machine with whatever OS you want. but you may experience package installation issues.

this is the best way to ensure that you are using the same version everyone else use.

Ingest data

the quantopian-quandl is a free daily bundle. every day you should execute this when live trading in order to get the most updated data

zipline ingest -b quantopian-quandl

there is no free minute data. you could use paid services and create a custom bundle for that. if you do have the data, the package supports minute algo-trading.

Running Backtests

you can run a backtest with this command:

zipline run -f zipline_repo/zipline/examples/dual_moving_average.py --start 2015-1-1 --end 2018-1-1 --bundle quantopian-quandl -o out.pickle --capital-base 10000
zipline-live

Run the cli tool

zipline run -f ~/zipline-algos/demo.py --state-file ~/zipline-algos/demo.state --realtime-bar-target ~/zipline-algos/realtime-bars/ --broker ib --broker-uri localhost:7496:1232 --bundle quantopian-quandl --data-frequency minute