All Projects → adegtyarev → docker-zipline

adegtyarev / docker-zipline

Licence: Apache-2.0 license
A collection of useful images to research with Zipline in CLI & GUI environments

Programming Languages

Dockerfile
14818 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to docker-zipline

jupyterlab-link-share
JupyterLab Extension to easily share a link to a running server on Binder
Stars: ✭ 40 (+73.91%)
Mutual labels:  jupyterlab
jupyter-offlinenotebook
Save and load notebooks to local-storage
Stars: ✭ 39 (+69.57%)
Mutual labels:  jupyterlab
nbcelltests
Cell-by-cell testing for production Jupyter notebooks in JupyterLab
Stars: ✭ 66 (+186.96%)
Mutual labels:  jupyterlab
theme-cookiecutter
A cookiecutter template to help you make new JupyterLab theme extensions
Stars: ✭ 47 (+104.35%)
Mutual labels:  jupyterlab
jupyterlab-vimrc
add a basic vimrc to jupyterlab vim
Stars: ✭ 59 (+156.52%)
Mutual labels:  jupyterlab
Quantitative-Big-Imaging-2018
(Latest semester at https://github.com/kmader/Quantitative-Big-Imaging-2019) The material for the Quantitative Big Imaging course at ETHZ for the Spring Semester 2018
Stars: ✭ 50 (+117.39%)
Mutual labels:  jupyterlab
jupyterlab-kubeflow-kale
JupyterLab extension to provide a Kubeflow specific left area for Notebooks deployment
Stars: ✭ 17 (-26.09%)
Mutual labels:  jupyterlab
backtrading-python-binance
Backtesting several trading strategy and rank them according their profit return.
Stars: ✭ 108 (+369.57%)
Mutual labels:  talib
jupyterlab-custom-css
Add custom CSS rules for JupyterLab
Stars: ✭ 32 (+39.13%)
Mutual labels:  jupyterlab
COVIDvu
Volunteers building and sharing current, accurate, near real-time COVID-19 tracking and prediction tools.
Stars: ✭ 15 (-34.78%)
Mutual labels:  jupyterlab
knowledgelab
KnowledgeRepo + JupyterLab
Stars: ✭ 46 (+100%)
Mutual labels:  jupyterlab
hub
Public reusable components for Polyaxon
Stars: ✭ 8 (-65.22%)
Mutual labels:  jupyterlab
jupyterlab plotly
This repository is deprecated. The extension has moved to https://github.com/jupyterlab/jupyter-renderers
Stars: ✭ 16 (-30.43%)
Mutual labels:  jupyterlab
jupyterlab iframe
View html as an embedded iframe in JupyterLab
Stars: ✭ 91 (+295.65%)
Mutual labels:  jupyterlab
quant
基于Django驱动的开源量化交易平台,功能模块有股票信息、交易策略、风险控制、消息通知、回测、交流社区、财经新闻
Stars: ✭ 57 (+147.83%)
Mutual labels:  zipline
rk
The remote Jupyter kernel/kernels administration utility
Stars: ✭ 53 (+130.43%)
Mutual labels:  jupyterlab
jupyterlab discovery
A JupyterLab extension to facilitate the discovery and installation of other extensions
Stars: ✭ 47 (+104.35%)
Mutual labels:  jupyterlab
naas
⚙️ Schedule notebooks, run them like APIs, expose securely your assets: Jupyter as a viable ⚡️ Production environment
Stars: ✭ 219 (+852.17%)
Mutual labels:  jupyterlab
jupyterlab-h5web
A JupyterLab extension to explore and visualize HDF5 file contents. Based on https://github.com/silx-kit/h5web.
Stars: ✭ 41 (+78.26%)
Mutual labels:  jupyterlab
jupyterlite
Wasm powered Jupyter running in the browser 💡
Stars: ✭ 3,039 (+13113.04%)
Mutual labels:  jupyterlab

A collection of Zipline images

  • Base Docker image with Zipline algorithmic trading library
  • Zipline & TA-lib libraries
  • Zipline & additional development modules
  • Zipline in JupyterLab research environment

Software specification

Build Status

Image Layers & size
adegtyarev/zipline:latest zipline:python3
adegtyarev/zipline:talib zipline:python3-talib
adegtyarev/zipline:dev zipline:python3-dev
adegtyarev/zipline:jupyterlab zipline:python3-jupyterlab

Quick start

Create a new volume to store permanent data (usually referred to as $ZIPLINE_ROOT):

docker volume create --name zipline-root

Run zipline command in a Docker container:

docker run --rm --volume zipline-root:/zipline adegtyarev/zipline
Usage: zipline [OPTIONS] COMMAND [ARGS]...

  Top level zipline entry point.
...

Usage

Command line tool

This image basically intended to be a drop-in replacement to zipline command in a Docker environment:

export ZIPLINE_CMD="docker run --rm -t -v zipline:/zipline adegtyarev/zipline zipline"

So that you just replace zipline with $ZIPLINE_CMD:

$ZIPLINE_CMD ingest -b quantopian-quandl
Downloading Bundle: quantopian-quandl  [####################################]  100%
INFO: ...: Writing data to /zipline/data/quantopian-quandl/2018-01-31T12;27;19.433422.

Run an example trading algorithm:

$ZIPLINE_CMD run -s 2017-1-1 -e 2018-1-1 -b quantopian-quandl -f zipline/examples/buy_and_hold.py

Research notebook

The image with jupyterlab is built with Zipline and JupyterLab computational environment. To use the image you will need a permanent volume to store notebooks:

docker volume create --name zipline-notes

docker run --rm -p 80:8888 \
    -v zipline-root:/zipline \
    -v zipline-notes:/notes \
    adegtyarev/zipline:jupyterlab

This will start a Jupyter HTTP-server with Zipline installed and notes volume attached to a directory which eventually is a chroot directory for the server. You can then connect to port 80 using a web browser.

Secure notebook with HTTPS

It is easy to secure your research environment by using SSL certificates from Let's Encrypt. You will need a new volume to keep certificates:

docker volume create --name zipline-certs

Run the following dummy command to attach the new volume with pre-defined permissions on directories inside /etc/letsencrypt:

docker run --rm -v zipline-certs:/etc/letsencrypt adegtyarev/zipline:jupyterlab true

Make sure you have port 80/tcp open to the outside world so that LE could connect to run a verification procedure. Use an official image of certbot/certbot to obtain SSL certificate and a key:

SSL_HOSTNAME=example.com    # Set this to the public domain name
SSL_EMAIL=$USER@$HOSTNAME   # Email address for important notifications from LE

docker run --rm -p 80:80 \
    -v zipline-certs:/etc/letsencrypt \
    certbot/certbot certonly --standalone \
    -d $SSL_HOSTNAME --agree-tos -m $SSL_EMAIL --non-interactive

Adjust permissions for a private key file to be able to run under a normal user instead of root:

docker run --rm -u root \
    -v zipline-certs:/etc/letsencrypt \
    adegtyarev/zipline:jupyterlab \
    chmod o+r /etc/letsencrypt/archive/$SSL_HOSTNAME/privkey1.pem

A secured JupyterLab should be ready to start now:

docker run --rm -p 443:8888 \
    -e SSL_HOSTNAME=$SSL_HOSTNAME \
    -v zipline-root:/zipline \
    -v zipline-notes:/notes \
    -v zipline-certs:/etc/letsencrypt \
    adegtyarev/zipline:jupyterlab lab-ssl

Note that a port to open in a browser has changed from 80 (HTTP) to 443 (HTTPS).

Using as a base image

The image may also be used as a base Docker image for Zipline-related tools:

    FROM    adegtyarev/zipline:latest

    COPY    --chown=zipline:zipline . /src/zipline-cool-feature

    RUN     cd /src/zipline-cool-feature && \
            pip3 install \
                --no-cache-dir \
                --user \
                -r requirements.txt && \
            pip3 install \
                --no-cache-dir \
                --user \
                --editable \
                .

    ...     # continue with zipline & cool feature installed

Author

Alexey Degtyarev [email protected]

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].