Zipline, a Pythonic Algorithmic Trading Library

Overview

Backtest your Trading Strategies

Version Info Python Anaconda-Server Badge Release Anaconda-Server Badge
Test Status CI Tests PyPI Anaconda Coverage Status
Community Discourse ML4T Twitter

Zipline is a Pythonic event-driven system for backtesting, developed and used as the backtesting and live-trading engine by crowd-sourced investment fund Quantopian. Since it closed late 2020, the domain that had hosted these docs expired. The library is used extensively in the book Machine Larning for Algorithmic Trading by Stefan Jansen who is trying to keep the library up to date and available to his readers and the wider Python algotrading community.

Features

  • Ease of Use: Zipline tries to get out of your way so that you can focus on algorithm development. See below for a code example.
  • Batteries Included: many common statistics like moving average and linear regression can be readily accessed from within a user-written algorithm.
  • PyData Integration: Input of historical data and output of performance statistics are based on Pandas DataFrames to integrate nicely into the existing PyData ecosystem.
  • Statistics and Machine Learning Libraries: You can use libraries like matplotlib, scipy, statsmodels, and scikit-klearn to support development, analysis, and visualization of state-of-the-art trading systems.

Installation

Zipline supports Python >= 3.7 and is compatible with current versions of the relevant NumFOCUS libraries, including pandas and scikit-learn.

If your system meets the pre-requisites described in the installation instructions, you can install Zipline using pip by running:

pip install zipline-reloaded

Alternatively, if you are using the Anaconda or miniconda distributions, you can use

conda install -c ml4t -c conda-forge -c ranaroussi zipline-reloaded

You can also enable conda-forge by listing it in your .condarc.

In case you are installing zipline-reloaded alongside other packages and encounter conflict errors, consider using mamba instead.

See the installation section of the docs for more detailed instructions.

Quickstart

See our getting started tutorial.

The following code implements a simple dual moving average algorithm.

long_mavg: # order_target orders as many shares as needed to # achieve the desired number of shares. order_target(context.asset, 100) elif short_mavg < long_mavg: order_target(context.asset, 0) # Save values for later inspection record(AAPL=data.current(context.asset, 'price'), short_mavg=short_mavg, long_mavg=long_mavg) ">
from zipline.api import order_target, record, symbol


def initialize(context):
    context.i = 0
    context.asset = symbol('AAPL')


def handle_data(context, data):
    # Skip first 300 days to get full windows
    context.i += 1
    if context.i < 300:
        return

    # Compute averages
    # data.history() has to be called with the same params
    # from above and returns a pandas dataframe.
    short_mavg = data.history(context.asset, 'price', bar_count=100, frequency="1d").mean()
    long_mavg = data.history(context.asset, 'price', bar_count=300, frequency="1d").mean()

    # Trading logic
    if short_mavg > long_mavg:
        # order_target orders as many shares as needed to
        # achieve the desired number of shares.
        order_target(context.asset, 100)
    elif short_mavg < long_mavg:
        order_target(context.asset, 0)

    # Save values for later inspection
    record(AAPL=data.current(context.asset, 'price'),
           short_mavg=short_mavg,
           long_mavg=long_mavg)

You can then run this algorithm using the Zipline CLI. But first, you need to download some market data with historical prices and trading volumes:

$ zipline ingest -b quandl
$ zipline run -f dual_moving_average.py --start 2014-1-1 --end 2018-1-1 -o dma.pickle --no-benchmark

This will download asset pricing data sourced from Quandl, and stream it through the algorithm over the specified time range. Then, the resulting performance DataFrame is saved as dma.pickle, which you can load and analyze from Python.

You can find other examples in the zipline/examples directory.

Questions, suggestions, bugs?

If you find a bug or have other questions about the library, feel free to open an issue and fill out the template.

Comments
  • Error importing zipline (trading calendars)

    Error importing zipline (trading calendars)

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: (Windows Version or $ uname --all) Ubuntu
    • Python Version: $ python --version : Python 3.9.1
    • Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
    • How did you install Zipline: (pip, conda, or other (please explain)) pip install zipline-reloeaded
    • Python packages: $ pip freeze or $ conda list
    • packages in environment at /home/jcx/miniconda3:

    Name Version Build Channel

    _libgcc_mutex 0.1 main
    alembic 1.6.5 pypi_0 pypi anyio 3.2.1 py39hf3d152e_0 conda-forge argon2-cffi 20.1.0 py39hbd71b63_2 conda-forge async_generator 1.10 py_0 conda-forge attrs 21.2.0 pyhd8ed1ab_0 conda-forge babel 2.9.1 pyh44b312d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcolz-zipline 1.2.3.post2 pypi_0 pypi bleach 3.3.0 pyh44b312d_0 conda-forge bottleneck 1.3.2 pypi_0 pypi brotlipy 0.7.0 py39h27cfd23_1003
    ca-certificates 2021.5.30 ha878542_0 conda-forge certifi 2021.5.30 py39hf3d152e_0 conda-forge cffi 1.14.4 py39h261ae71_0
    chardet 3.0.4 py39h06a4308_1003
    click 8.0.1 pypi_0 pypi conda 4.10.3 py39hf3d152e_0 conda-forge conda-package-handling 1.7.2 py39h27cfd23_1
    cryptography 3.3.1 py39h3c74f83_0
    decorator 4.4.2 pypi_0 pypi defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge empyrical-reloaded 0.5.7 pypi_0 pypi entrypoints 0.3 pyhd8ed1ab_1003 conda-forge greenlet 1.1.0 pypi_0 pypi h5py 3.3.0 pypi_0 pypi idna 2.10 py_0
    importlib-metadata 4.6.0 py39hf3d152e_0 conda-forge intervaltree 3.1.0 pypi_0 pypi ipykernel 5.5.5 py39hef51801_0 conda-forge ipython 7.25.0 py39hef51801_1 conda-forge ipython_genutils 0.2.0 py_1 conda-forge iso3166 1.0.1 pypi_0 pypi iso4217 1.6.20180829 pypi_0 pypi jedi 0.18.0 py39hf3d152e_2 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_core 4.7.1 py39hf3d152e_0 conda-forge jupyter_server 1.9.0 pyhd8ed1ab_0 conda-forge jupyterlab 3.0.16 pyhd8ed1ab_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_server 2.6.0 pyhd8ed1ab_0 conda-forge ld_impl_linux-64 2.33.1 h53a641e_7
    libedit 3.1.20191231 h14c3975_1
    libffi 3.3 he6710b0_2
    libgcc-ng 9.1.0 hdf63c60_0
    libsodium 1.0.18 h36c2ea0_1 conda-forge libstdcxx-ng 9.1.0 hdf63c60_0
    logbook 1.5.3 pypi_0 pypi lru-dict 1.1.7 pypi_0 pypi lxml 4.6.3 pypi_0 pypi mako 1.1.4 pypi_0 pypi markupsafe 1.1.1 py39h38d8fee_2 conda-forge matplotlib-inline 0.1.2 pyhd8ed1ab_2 conda-forge mistune 0.8.4 py39hbd71b63_1002 conda-forge multipledispatch 0.6.0 pypi_0 pypi multitasking 0.0.9 pypi_0 pypi nbclassic 0.3.1 pyhd8ed1ab_1 conda-forge nbclient 0.5.3 pyhd8ed1ab_0 conda-forge nbconvert 6.1.0 py39hf3d152e_0 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge ncurses 6.2 he6710b0_1
    nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge networkx 2.5.1 pypi_0 pypi notebook 6.4.0 pyha770c72_0 conda-forge numexpr 2.7.3 pypi_0 pypi numpy 1.21.0 pypi_0 pypi openssl 1.1.1k h27cfd23_0
    packaging 21.0 pyhd8ed1ab_0 conda-forge pandas 1.3.0 pypi_0 pypi pandas-datareader 0.9.0 pypi_0 pypi pandoc 2.14.0.3 h7f98852_0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.8.2 pyhd8ed1ab_0 conda-forge patsy 0.5.1 pypi_0 pypi pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pip 20.3.1 py39h06a4308_0
    prometheus_client 0.11.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.19 pyha770c72_0 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pycosat 0.6.3 py39h27cfd23_0
    pycparser 2.20 py_2
    pygments 2.9.0 pyhd8ed1ab_0 conda-forge pyopenssl 20.0.0 pyhd3eb1b0_1
    pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.17.3 py39hbd71b63_1 conda-forge pysocks 1.7.1 py39h06a4308_0
    python 3.9.1 hdb3f193_2
    python-dateutil 2.8.1 py_0 conda-forge python-editor 1.0.4 pypi_0 pypi python-interface 1.6.1 pypi_0 pypi python_abi 3.9 2_cp39 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyzmq 19.0.2 py39hb69f2a1_2 conda-forge readline 8.0 h7b6447c_0
    requests 2.25.0 pyhd3eb1b0_0
    requests-unixsocket 0.2.0 py_0 conda-forge ruamel_yaml 0.15.80 py39h27cfd23_0
    scipy 1.7.0 pypi_0 pypi send2trash 1.7.1 pyhd8ed1ab_0 conda-forge setuptools 51.0.0 py39h06a4308_2
    six 1.15.0 py39h06a4308_0
    sniffio 1.2.0 py39hf3d152e_1 conda-forge sortedcontainers 2.4.0 pypi_0 pypi sqlalchemy 1.4.20 pypi_0 pypi sqlite 3.33.0 h62c20be_0
    statsmodels 0.12.2 pypi_0 pypi ta-lib 0.4.20 pypi_0 pypi terminado 0.10.1 py39hf3d152e_0 conda-forge testpath 0.5.0 pyhd8ed1ab_0 conda-forge tk 8.6.10 hbc83047_0
    toolz 0.11.1 pypi_0 pypi tornado 6.1 py39hbd71b63_0 conda-forge tqdm 4.54.1 pyhd3eb1b0_0
    trading-calendars 2.1.1 pypi_0 pypi traitlets 5.0.5 py_0 conda-forge tzdata 2020d h14c3975_0
    urllib3 1.25.11 py_0
    wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge websocket-client 0.57.0 py39hf3d152e_4 conda-forge wheel 0.36.1 pyhd3eb1b0_0
    xz 5.2.5 h7b6447c_0
    yaml 0.2.5 h7b6447c_0
    yfinance 0.1.60 pypi_0 pypi zeromq 4.3.4 h2531618_0
    zipline-reloaded 2.0.0.post1 pypi_0 pypi zipp 3.5.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h7b6447c_3

    Now that you know a little about me, let me tell you about the issue I am having:

    Description of Issue

    When i use import zipline a recive an error i cant fix

    • What did you expect to happen? just import zipline
    • What happened instead?

    TypeError Traceback (most recent call last) in ----> 1 import zipline

    ~/miniconda3/lib/python3.9/site-packages/zipline/init.py in 19 # This is not a place to dump arbitrary classes/modules for convenience, 20 # it is a place to expose the public interfaces. ---> 21 from trading_calendars import get_calendar 22 23 from . import data

    ~/miniconda3/lib/python3.9/site-packages/trading_calendars/init.py in 14 # limitations under the License. 15 ---> 16 from .trading_calendar import TradingCalendar 17 from .calendar_utils import ( 18 clear_calendars,

    ~/miniconda3/lib/python3.9/site-packages/trading_calendars/trading_calendar.py in 31 import toolz 32 ---> 33 from .calendar_helpers import ( 34 NP_NAT, 35 compute_all_minutes,

    ~/miniconda3/lib/python3.9/site-packages/trading_calendars/calendar_helpers.py in 4 NANOSECONDS_PER_MINUTE = int(6e10) 5 ----> 6 NP_NAT = np.array([pd.NaT], dtype=np.int64)[0] 7 8

    TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'

    Here is how you can reproduce this issue on your machine:

    Reproduction Steps

    1. create conda env
    2. pip install zipline-reloaded
    3. from jupyterlab import zipline ...

    What steps have you taken to resolve this already?

    ...

    Anything else?

    ...

    Sincerely,

    JCX

    opened by Tvix22 12
  • Change to iso3166

    Change to iso3166

    ISO3166 has been updated, “Turkey” changed to “Türkiye”. This causes various things to break that relied on "TURKEY", setting ISO==2.02 works. This is not necessarily a zipline problem, but can cause issues for fresh installs. Posting here in case anyone else has the problem. pip install iso3166==2.02 solves it

    https://pypi.org/project/iso3166/ 2.1.0 - July 11, 2022 -Updated entries ---“Turkey” changed to “Türkiye”

    opened by pfin 6
  • Not able to run zipline-bundle

    Not able to run zipline-bundle

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: (Windows Version or $ uname --all)

    Linux ubuntu-4gb-nbg1-1 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    • Python Version: $ python --version Python 3.8.11

    • Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))' (zipline-38-pip) arsh@ubuntu-4gb-nbg1-1:~/zipline-reloaded$ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'64

    • How did you install Zipline: (pip, conda, or other (please explain)) conda and pip both

    • Python packages: $ pip freeze or $ conda list

    packages in environment at /home/arsh/anaconda3/envs/zipline-38-pip:

    Name Version Build Channel

    _libgcc_mutex 0.1 main
    _openmp_mutex 4.5 1_gnu
    alembic 1.7.3 pyhd8ed1ab_0 conda-forge bcolz-zipline 1.2.4 py38hef53783_0 ml4t bottleneck 1.3.2 py38h5c078b8_3 conda-forge brotlipy 0.7.0 py38h497a2fe_1001 conda-forge ca-certificates 2021.5.30 ha878542_0 conda-forge certifi 2021.5.30 py38h578d9bd_0 conda-forge cffi 1.14.6 py38ha65f79e_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge charset-normalizer 2.0.6 pypi_0 pypi click 8.0.1 py38h578d9bd_0 conda-forge cryptography 3.4.7 py38ha5dfef3_0 conda-forge cython 0.29.24 pypi_0 pypi decorator 4.4.2 py_0 conda-forge empyrical-reloaded 0.5.8 py38_0 ml4t greenlet 1.1.1 pypi_0 pypi h5py 2.10.0 nompi_py38h513d04c_102 conda-forge hdf5 1.10.5 nompi_h5b725eb_1114 conda-forge icu 68.1 h58526e2_0 conda-forge idna 3.2 pypi_0 pypi importlib-metadata 4.8.1 py38h578d9bd_0 conda-forge importlib_resources 5.2.2 pyhd8ed1ab_0 conda-forge intervaltree 3.0.2 py_0 conda-forge iso3166 2.0.1 pyhd8ed1ab_0 conda-forge iso4217 1.6.20180829 py_0 conda-forge ld_impl_linux-64 2.35.1 h7274673_9
    libblas 3.9.0 11_linux64_openblas conda-forge libcblas 3.9.0 11_linux64_openblas conda-forge libffi 3.3 he6710b0_2
    libgcc-ng 9.3.0 h5101ec6_17
    libgfortran-ng 11.2.0 h69a702a_8 conda-forge libgfortran5 11.2.0 h5c6108e_8 conda-forge libgomp 9.3.0 h5101ec6_17
    libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 11_linux64_openblas conda-forge libopenblas 0.3.17 pthreads_h8fe5266_1 conda-forge libstdcxx-ng 9.3.0 hd4cf53a_17
    libxml2 2.9.12 h72842e0_0 conda-forge libxslt 1.1.33 h15afd5d_2 conda-forge logbook 1.5.3 py38_0 ml4t lru-dict 1.1.7 py38h497a2fe_0 conda-forge lxml 4.6.3 py38hf1fe3a4_0 conda-forge mako 1.1.5 pyhd8ed1ab_0 conda-forge markupsafe 2.0.1 py38h497a2fe_0 conda-forge multipledispatch 0.6.0 pypi_0 pypi multitasking 0.0.9 pyhd8ed1ab_0 conda-forge ncurses 6.2 he6710b0_1
    networkx 2.5.1 pyhd8ed1ab_0 conda-forge numexpr 2.7.3 py38h51da96c_0 conda-forge numpy 1.21.2 pypi_0 pypi openssl 1.1.1l h7f8727e_0
    pandas 1.2.5 pypi_0 pypi pandas-datareader 0.10.0 pyh6c4a22f_0 conda-forge patsy 0.5.1 py_0 conda-forge pip 21.0.1 py38h06a4308_0
    pycparser 2.20 pyh9f0ad1d_2 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge python 3.8.11 h12debd9_0_cpython
    python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-interface 1.6.0 py_0 conda-forge python_abi 3.8 2_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge readline 8.1 h27cfd23_0
    requests 2.26.0 pyhd8ed1ab_0 conda-forge scipy 1.7.1 pypi_0 pypi setuptools 58.0.4 py38h06a4308_0
    six 1.16.0 pyh6c4a22f_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sqlalchemy 1.4.23 pypi_0 pypi sqlite 3.36.0 hc218d9a_0
    statsmodels 0.12.2 py38h5c078b8_0 conda-forge ta-lib 0.4.19 py38hfeaa757_0 ml4t tables 3.6.1 pypi_0 pypi tk 8.6.10 hbc83047_0
    toolz 0.11.1 py_0 conda-forge trading-calendars 2.1.1 pyhd3deb0d_0 conda-forge urllib3 1.26.6 pyhd8ed1ab_0 conda-forge wheel 0.37.0 pyhd3eb1b0_1
    xz 5.2.5 h7b6447c_0
    yfinance 0.1.63 py_0 ml4t zipline-reloaded 2.0.0.post1+36.g5e2fc85e pypi_0 pypi zipp 3.5.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h7b6447c_3

    Now that you know a little about me, let me tell you about the issue I am having:

    Description of Issue

    • What did you expect to happen? I am trying to ingest data but at initial step I am getting following error.
    • What happened instead?

    Here is how you can reproduce this issue on your machine:

    Reproduction Steps

    Traceback (most recent call last): File "/home/arsh/anaconda3/envs/zipline-38/bin/zipline", line 7, in from zipline.main import main File "/home/arsh/anaconda3/envs/zipline-38/lib/python3.8/site-packages/zipline/init.py", line 21, in from trading_calendars import get_calendar File "/home/arsh/anaconda3/envs/zipline-38/lib/python3.8/site-packages/trading_calendars/init.py", line 16, in from .trading_calendar import TradingCalendar File "/home/arsh/anaconda3/envs/zipline-38/lib/python3.8/site-packages/trading_calendars/trading_calendar.py", line 33, in from .calendar_helpers import ( File "/home/arsh/anaconda3/envs/zipline-38/lib/python3.8/site-packages/trading_calendars/calendar_helpers.py", line 6, in NP_NAT = np.array([pd.NaT], dtype=np.int64)[0] TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'

    What steps have you taken to resolve this already?

    Sincerely, $ whoami

    opened by arshpreetsingh 6
  • Limit orders bug

    Limit orders bug

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: Linux rocket 5.10.16-arch1-1 #1 SMP PREEMPT Sat, 13 Feb 2021 20:50:18 +0000 x86_64 GNU/Linux
    • Python Version: Python 3.9.4
    • Python Bitness: 64
    • How did you install Zipline: git clone && pip install .
    • Python packages:
    absl-py @ file:///tmp/build/80754af9/absl-py_1615410667905/work
    aiohttp @ file:///tmp/build/80754af9/aiohttp_1614360979875/work
    alabaster==0.7.12
    alembic==1.6.2
    alphalens-reloaded==0.4.1.post1
    anyio @ file:///tmp/build/80754af9/anyio_1617783277988/work/dist
    argon2-cffi @ file:///tmp/build/80754af9/argon2-cffi_1613037499734/work
    astunparse==1.6.3
    async-generator @ file:///home/ktietz/src/ci/async_generator_1611927993394/work
    async-timeout==3.0.1
    attrs @ file:///tmp/build/80754af9/attrs_1604765588209/work
    awswrangler==2.4.0
    Babel==2.9.0
    backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
    bcolz-zipline==1.2.3.post2
    beautifulsoup4==4.9.3
    bleach @ file:///tmp/build/80754af9/bleach_1612211392645/work
    blinker==1.4
    boto3==1.17.8
    botocore==1.20.8
    Bottleneck==1.3.2
    brotlipy==0.7.0
    cachetools @ file:///tmp/build/80754af9/cachetools_1619597386817/work
    certifi==2020.12.5
    cffi @ file:///tmp/build/80754af9/cffi_1613246951236/work
    chardet==4.0.0
    click==8.0.0
    configparser==5.0.1
    coverage @ file:///tmp/build/80754af9/coverage_1614614861224/work
    cryptography @ file:///tmp/build/80754af9/cryptography_1616767007030/work
    cycler==0.10.0
    Cython @ file:///tmp/build/80754af9/cython_1618435158654/work
    dateparser==1.0.0
    decorator==4.4.2
    defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
    docker-pycreds==0.4.0
    docutils==0.16
    empyrical-reloaded==0.5.7
    entrypoints==0.3
    et-xmlfile==1.0.1
    flatbuffers @ file:///tmp/build/80754af9/python-flatbuffers_1614345733764/work
    gast @ file:///tmp/build/80754af9/gast_1597433534803/work
    gitdb==4.0.5
    GitPython==3.1.13
    google-auth @ file:///tmp/build/80754af9/google-auth_1619477128713/work
    google-auth-oauthlib @ file:///tmp/build/80754af9/google-auth-oauthlib_1617120569401/work
    google-pasta==0.2.0
    greenlet==1.1.0
    grpcio @ file:///tmp/build/80754af9/grpcio_1614884176703/work
    h5py==3.2.1
    idna==2.10
    imagesize==1.2.0
    importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1617877307939/work
    intervaltree==3.1.0
    ipykernel @ file:///tmp/build/80754af9/ipykernel_1607452791405/work/dist/ipykernel-5.3.4-py3-none-any.whl
    ipython @ file:///tmp/build/80754af9/ipython_1617120888991/work
    ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work
    iso3166==1.0.1
    iso4217==1.6.20180829
    jdcal==1.4.1
    jedi @ file:///tmp/build/80754af9/jedi_1606932531272/work
    Jinja2==2.11.3
    jmespath==0.10.0
    joblib==1.0.1
    json5==0.9.5
    jsonschema @ file:///tmp/build/80754af9/jsonschema_1602607155483/work
    jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work
    jupyter-core @ file:///tmp/build/80754af9/jupyter_core_1612213314396/work
    jupyter-packaging @ file:///tmp/build/80754af9/jupyter-packaging_1613502826984/work
    jupyter-server @ file:///tmp/build/80754af9/jupyter_server_1616084066671/work
    jupyterlab @ file:///tmp/build/80754af9/jupyterlab_1619133235951/work
    jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work
    jupyterlab-server @ file:///tmp/build/80754af9/jupyterlab_server_1617134334258/work
    Keras-Preprocessing @ file:///tmp/build/80754af9/keras-preprocessing_1612283640596/work
    kiwisolver==1.3.1
    lazy-object-proxy==1.4.3
    llvmlite==0.36.0
    Logbook==1.5.3
    lru-dict==1.1.7
    lxml==4.6.3
    Mako==1.1.4
    Markdown @ file:///tmp/build/80754af9/markdown_1614363852612/work
    MarkupSafe==2.0.0
    matplotlib==3.3.4
    mccabe==0.6.1
    mistune @ file:///tmp/build/80754af9/mistune_1607364877025/work
    mkl-fft==1.3.0
    mkl-random @ file:///tmp/build/80754af9/mkl_random_1618853971975/work
    mkl-service==2.3.0
    multidict @ file:///tmp/build/80754af9/multidict_1607367781142/work
    multipledispatch==0.6.0
    multitasking==0.0.9
    nbclassic @ file:///tmp/build/80754af9/nbclassic_1616085367084/work
    nbclient @ file:///tmp/build/80754af9/nbclient_1614364831625/work
    nbconvert @ file:///tmp/build/80754af9/nbconvert_1607370433589/work
    nbformat @ file:///tmp/build/80754af9/nbformat_1617383369282/work
    nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1613680548246/work
    networkx==2.5.1
    notebook @ file:///tmp/build/80754af9/notebook_1616443118287/work
    numba @ file:///tmp/build/80754af9/numba_1616774250644/work
    numexpr==2.7.3
    numpy==1.20.3
    oauthlib==3.1.0
    openpyxl==3.0.6
    opt-einsum==3.1.0
    osqp==0.6.2.post0
    packaging @ file:///tmp/build/80754af9/packaging_1611952188834/work
    pandas==1.2.4
    pandas-datareader==0.9.0
    pandocfilters @ file:///tmp/build/80754af9/pandocfilters_1605120906940/work
    parso==0.7.0
    pathtools==0.1.2
    patsy==0.5.1
    pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work
    pg8000==1.17.0
    pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work
    Pillow==8.1.0
    plotly==4.14.3
    prometheus-client @ file:///tmp/build/80754af9/prometheus_client_1618088486455/work
    promise==2.3
    prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1616415428029/work
    protobuf==3.14.0
    psutil==5.8.0
    ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
    pyarrow==3.0.0
    pyasn1==0.4.8
    pyasn1-modules==0.2.8
    pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work
    pyfinance==1.3.0
    Pygments==2.8.0
    PyJWT @ file:///tmp/build/80754af9/pyjwt_1619682484438/work
    PyMySQL==1.0.2
    pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1608057966937/work
    pyparsing @ file:///home/linux1/recipes/ci/pyparsing_1610983426697/work
    pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1607365177477/work
    PySocks @ file:///tmp/build/80754af9/pysocks_1605305812635/work
    python-binance==1.0.7
    python-dateutil @ file:///home/ktietz/src/ci/python-dateutil_1611928101742/work
    python-editor==1.0.4
    python-interface==1.6.1
    pytz @ file:///tmp/build/80754af9/pytz_1612215392582/work
    PyYAML==5.4.1
    pyzmq==20.0.0
    qdldl==0.1.5.post0
    redshift-connector==2.0.874
    regex==2021.4.4
    requests==2.25.1
    requests-oauthlib==1.3.0
    rsa @ file:///tmp/build/80754af9/rsa_1614366226499/work
    s3transfer==0.3.4
    scikit-learn==0.24.1
    scipy==1.6.3
    scramp==1.2.0
    scs==2.1.2
    seaborn==0.11.1
    Send2Trash @ file:///tmp/build/80754af9/send2trash_1607525499227/work
    sentry-sdk==0.20.2
    shortuuid==1.0.1
    six==1.16.0
    sklearn==0.0
    smmap==3.0.5
    sniffio @ file:///tmp/build/80754af9/sniffio_1614030464178/work
    snowballstemmer==2.1.0
    sortedcontainers==2.3.0
    soupsieve==2.2
    Sphinx==3.5.1
    sphinxcontrib-applehelp==1.0.2
    sphinxcontrib-devhelp==1.0.2
    sphinxcontrib-htmlhelp==1.0.3
    sphinxcontrib-jsmath==1.0.1
    sphinxcontrib-qthelp==1.0.3
    sphinxcontrib-serializinghtml==1.1.4
    SQLAlchemy==1.4.15
    statsmodels==0.12.2
    subprocess32==3.5.4
    TA-Lib==0.4.19
    tables==3.6.1
    tensorboard @ file:///home/builder/ktietz/aggregate/tensorflow_recipes/ci_te/tensorboard_1614593728657/work/tmp_pip_dir
    tensorboard-plugin-wit==1.6.0
    tensorflow @ file:///home/builder/ktietz/aggregate/tensorflow_recipes/ci_cpu/tensorflow-base_1614360980945/work/tensorflow_pkg/tensorflow-2.4.1-cp39-cp39-linux_x86_64.whl
    tensorflow-estimator @ file:///home/builder/ktietz/aggregate/tensorflow_recipes/ci_te/tensorflow-estimator_1614592767119/work/whl_temp/tensorflow_estimator-2.4.0-py2.py3-none-any.whl
    termcolor==1.1.0
    terminado==0.9.4
    testpath @ file:///home/ktietz/src/ci/testpath_1611930608132/work
    threadpoolctl==2.1.0
    toolz==0.11.1
    tornado @ file:///tmp/build/80754af9/tornado_1606942317143/work
    trading-calendars==2.1.1
    traitlets @ file:///home/ktietz/src/ci/traitlets_1611929699868/work
    typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1611751222202/work
    tzlocal==2.1
    ujson==4.0.2
    urllib3==1.26.4
    wandb==0.10.19
    wcwidth @ file:///tmp/build/80754af9/wcwidth_1593447189090/work
    webencodings==0.5.1
    websockets==9.0.1
    Werkzeug @ file:///home/ktietz/src/ci/werkzeug_1611932622770/work
    wrapt==1.12.1
    xlrd==2.0.1
    xmltodict==0.12.0
    yarl @ file:///tmp/build/80754af9/yarl_1606939947528/work
    yfinance==0.1.59
    zipline-reloaded==2.0.0.post1
    zipp @ file:///tmp/build/80754af9/zipp_1615904174917/work
    

    Now that you know a little about me, let me tell you about the issue I am having:

    Description of Issue

    • What did you expect to happen?

    I expect a limit order to respect the specified ---capital-base and the order_target(target=X) target setting.

    • What happened instead?

    On a custom test with BTC data and 24/7 market it's totally broken. In a simpler test with AAPL, it buys 13 shares at first.

    Here is how you can reproduce this issue on your machine:

    https://exchange.ml4trading.io/uploads/default/original/1X/4cb658a17618f5c4f373a0422443ce9f8d1f7a05.png

    Reproduction Steps

    1. Sync the quandl bundle
    2. Copy the code from the image given above
    3. Run ...

    What steps have you taken to resolve this already?

    I pray to the universe for help.

    ...

    Anything else?

    ...

    Sincerely, ydm

    opened by ydm 6
  • Unable to install zipline-reloaded using Conda on Win 10/64

    Unable to install zipline-reloaded using Conda on Win 10/64

    Dear Zipline Maintainers,

    Environment

    • Operating System: Win10/64bit
    • Python Version: 3.8.8
    • Python Bitness: 64
    • How did you install Zipline: conda
    • Python packages: ca-certificates 2021.4.13 haa95532_1 certifi 2020.12.5 py38haa95532_0 openssl 1.1.1k h2bbff1b_0 pip 21.0.1 py38haa95532_0 python 3.8.8 hdbf39b2_5 setuptools 52.0.0 py38haa95532_0 sqlite 3.35.4 h2bbff1b_0 vc 14.2 h21ff451_1 vs2015_runtime 14.27.29016 h5e58377_2 wheel 0.36.2 pyhd3eb1b0_0 wincertstore 0.2 py38_0

    conda --version reports: Conda v4.9.2

    Description of Issue

    • Whilst attempting to install zipline-reloaded, with the recomended conda environment and install instructions a nebulous error message occurs:
    
    UnsatisfiableError: The following specifications were found to be incompatible with each other:
    
    Output in format: Requested package -> Available version
    

    Full error message here:

    (env_zipline) C:\Users\richa>conda install -v -c ml4t zipline-reloaded
    Collecting package metadata (current_repodata.json): ...working... Unable to retrieve repodata (response: 404) for https://conda.anaconda.org/ml4t/win-64/current_repodata.json
    
    done
    Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
    Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
    Collecting package metadata (repodata.json): ...working... done
    Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
    Solving environment: ...working...
    Found conflicts! Looking for incompatible packages.
    This can take several minutes.  Press CTRL-C to abort.
    failed
    Traceback (most recent call last):
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 281, in solve_final_state
        ssc = self._run_sat(ssc)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 815, in _run_sat
        ssc.solution_precs = ssc.r.solve(tuple(final_environment_specs),
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\resolve.py", line 1320, in solve
        raise UnsatisfiableError({})
    conda.exceptions.UnsatisfiableError:
    Did not find conflicting dependencies. If you would like to know which
    packages conflict ensure that you have enabled unsatisfiable hints.
    
    conda config --set unsatisfiable_hints True
    
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\install.py", line 308, in install
        raise e
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\cli\install.py", line 295, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 275, in solve_final_state
        ssc = self._add_specs(ssc)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\core\solve.py", line 704, in _add_specs
        ssc.r.find_conflicts(spec_set)
      File "C:\Users\richa\anaconda3\lib\site-packages\conda\resolve.py", line 352, in find_conflicts
        raise UnsatisfiableError(bad_deps, strict=strict_channel_priority)
    conda.exceptions.UnsatisfiableError: The following specifications were found to be incompatible with each other:
    
    Output in format: Requested package -> Available versions
    

    Reproduction Steps

    1. Start anaconda prompt in base environment
    2. conda create -n env_zipline python=3.8
    3. conda activate env_zipline
    4. conda install -v -c ml4t zipline-reloaded

    What steps have you taken to resolve this already?

    I tried a brand new Conda installation (installed Miniconda3 from: https://docs.conda.io/en/latest/miniconda.html on a clean VM - same issue.

    Since this error message seems related: Unable to retrieve repodata (response: 404) for https://conda.anaconda.org/ml4t/win-64/current_repodata.json Thinking this might be a Conda bug, I tried:

    conda activate base
    conda update --all
    conda activate env_zipline
    conda install -v -c ml4t zipline-reloaded
    

    This upgraded conda to v4.10.1, but bombed with same error

    There was a hint to try using conda config --set unsatisfiable_hints True

    So ran that then and again tried: conda install -v -c ml4t zipline-reloaded but the same nebulous error resulted.

    Also tried --force --nodeps, and --only-deps to try and figure out where the issue was coming from and --clobber.

    Also tried it with a Python 3.9 environment instead:

    conda activate base
    conda create -n env_zipline39 python=3.9
    conda activate env_zipline39
    conda install -v -c ml4t zipline-reloaded
    

    Same error in Python 3.9 environment too.

    Then uninstalled Miniconda/Py39 downloaded Minicon3/Windows 64-bit/Python 3.8 from: htts://conda.io/en/latest/miniconda.html

    conda create -n env_zipline3 python=3.8
    conda activate env_zipline38
    conda install -v -c ml4t zipline-reloaded
    

    This had the same issue.

    Also tried a Python 3.7 environment - same issue.

    Also tried

    conda activate base
    conda update conda
    

    then re-running the installs above - same issue.

    Also tried with the full Anaconda installer (instead of Miniconda) - same issue.

    I was going to try an earlier version of Zipline-reloaded, but only 2.0.0rc4 is available on Conda.

    Other

    I have cloneable/pristine Win10/64 VMs that I can do further testing on this as required. Happy to assist here.

    Best regards, Richard Dale

    opened by RichardDale 6
  • Unable to use the latest Zipline

    Unable to use the latest Zipline

    Dear Zipline Maintainers,

    • Operating System: windows 10
    • Python Version: Python 3.7.13
    • Python Bitness:
    • How did you install Zipline: conda
    • Python packages: $ pip freeze or $ conda list
    1. I used the following command to install "C:\Users\Administrator>conda install -c ml4t -c conda-forge -c ranaroussi zipline-reloaded" 2、I then tried to command zipline with an error。

    (base) C:\Users\Administrator>zipline Traceback (most recent call last): File "d:\Anaconda3\Scripts\zipline-script.py", line 6, in from zipline.main import main File "d:\Anaconda3\lib\site-packages\zipline_init_.py", line 29, in from .utils.run_algo import run_algorithm File "d:\Anaconda3\lib\site-packages\zipline\utils\run_algo.py", line 24, in from zipline.pipeline.data import USEquityPricing File "d:\Anaconda3\lib\site-packages\zipline\pipeline_init_.py", line 1, in from .classifiers import Classifier, CustomClassifier File "d:\Anaconda3\lib\site-packages\zipline\pipeline\classifiers_init_.py", line 1, in from .classifier import ( File "d:\Anaconda3\lib\site-packages\zipline\pipeline\classifiers\classifier.py", line 22, in from zipline.pipeline.term import ComputableTerm File "d:\Anaconda3\lib\site-packages\zipline\pipeline\term.py", line 45, in from .domain import Domain, GENERIC, infer_domain File "d:\Anaconda3\lib\site-packages\zipline\pipeline\domain.py", line 27, in from zipline.country import CountryCode File "d:\Anaconda3\lib\site-packages\zipline\country.py", line 10, in class CountryCode(object): File "d:\Anaconda3\lib\site-packages\zipline\country.py", line 55, in CountryCode TURKEY = code("TURKEY") File "d:\Anaconda3\lib\site-packages\zipline\country.py", line 7, in code return countries_by_name[name].alpha2 KeyError: 'TURKEY'

    Sincerely, ltq_quant

    opened by quantltq 5
  • Error pops up from bcolz while ingesting csv data into zipline-reloaded

    Error pops up from bcolz while ingesting csv data into zipline-reloaded

    I was running zipline for quite a long time now and I was using csv data to ingest into zipline. Today I updated the environment and now bcolz shows an new error while trying to ingest the csv data.

    System data Compiler : Clang 11.1.0 OS : Darwin Release : 21.5.0 Machine : x86_64 Processor : i386 CPU cores : 16 Architecture: 64bit

    Error Traceback (most recent call last): File "/Users/mw/opt/anaconda3/envs/ml4t/bin/zipline", line 11, in <module> sys.exit(main()) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/click/core.py", line 1128, in __call__ return self.main(*args, **kwargs) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/zipline/__main__.py", line 389, in ingest bundles_module.ingest( File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/zipline/data/bundles/core.py", line 415, in ingest daily_bar_writer.write(()) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/zipline/data/bcolz_daily_bars.py", line 209, in write return self._write_internal(it, assets) File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/zipline/data/bcolz_daily_bars.py", line 250, in _write_internal columns = { File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/zipline/data/bcolz_daily_bars.py", line 251, in <dictcomp> k: carray(array([], dtype=uint32_dtype)) File "bcolz/carray_ext.pyx", line 1063, in bcolz.carray_ext.carray.__cinit__ File "bcolz/carray_ext.pyx", line 1132, in bcolz.carray_ext.carray._create_carray File "/Users/mw/opt/anaconda3/envs/ml4t/lib/python3.8/site-packages/bcolz/utils.py", line 113, in to_ndarray if array.dtype != dtype.base: AttributeError: 'NoneType' object has no attribute 'base'

    opened by Moccazio 5
  • Exception: Must provide either benchmark_asset or benchmark_returns.

    Exception: Must provide either benchmark_asset or benchmark_returns.

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System:Linux research85 4.15.0-134-generic #138-Ubuntu SMP Fri Jan 15 10:52:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    • Python Version: Python 3.8.0
    • Python Bitness: 64
    • How did you install Zipline: pip
    • Python packages: conda list

    Now that you know a little about me, let me tell you about the issue I am having:

    Description of Issue

    Just trying to run the examples from the beginner tutorial, and when I run the jupyter cell

    %%zipline --start 2016-1-1 --end 2018-1-1
    from zipline.api import symbol, order, record
    
    def initialize(context):
        pass
    
    def handle_data(context, data):
        order(symbol('AAPL'), 10)
        record(AAPL=data[symbol('AAPL')].price)
    

    I get

    Exception: Must provide either benchmark_asset or benchmark_returns.

    Sincerely,

    opened by jcrangel 5
  • TypeError: Expected data of type float64 for column 'ratio', but got 'object'.

    TypeError: Expected data of type float64 for column 'ratio', but got 'object'.

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: Linux localhost.localdomain 5.11.17-300.fc34.x86_64 #1 SMP Wed Apr 28 14:21:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    • Python Version: Python 3.9.4
    • Python Bitness: 64
    • How did you install Zipline: pip
    • Python packages: Too long, didn't paste in

    Now that you know a little about me, let me tell you about the issue I am having:

    Description of Issue

    I was trying to create a bundle out of CSV files containing LSE stock prices, so I set the calendar to LSE. Prior to the ingestion I imputed the missing dates into all CSVs like they said in this old Quantopian thread: https://quantopian-archive.netlify.app/forum/threads/data-bundle-error-help.html and as a result I encountered the same error the last person in that thread reported. Unfortunately there was no follow-up on that thread and no workaround provided. It seems like zipline-reloaded inherited the same behavior. I wonder how to fix it.

    • What did you expect to happen? A new bundle to be created.
    • What happened instead? Zipline threw the error: TypeError: Expected data of type float64 for column 'ratio', but got 'object'.

    Here is how you can reproduce this issue on your machine:

    Reproduction Steps

    1. Download prices to CSVs.
    2. Expand the dates to include the missing dates according to LSE calendar.
    3. Attempt to ingest the bundle. ...

    What steps have you taken to resolve this already?

    Searching for answers online.

    ...

    Sincerely, mac133k

    opened by mac133k 5
  • Mamba/Conda installs 2.0.0.rc4 instead of 2.0.0.post1

    Mamba/Conda installs 2.0.0.rc4 instead of 2.0.0.post1

    Hi Stefan,

    Nice work on packaging up 2.0.0.post1 - I've seen the recent commits and it looks like a complex task juggling all those items.

    However, using either conda or mamba installs 2.0.0.rc4 instead of 2.0.0.post1

    Perhaps you need to change the versioning convention? 2.0.1 might be better?

    Reproduction Steps

    conda create -n zip38 python=3.8 conda activate zip38 conda install -c ml4t -c conda-forge

    conda create -n zip38 python=3.8 conda activate zip38 conda install -y -c conda-forge mamba mamba install -c ml4t -c conda-forge

    Cheers, Richard.

    opened by RichardDale 5
  • After 100 times i'm always getting an ERROR!

    After 100 times i'm always getting an ERROR!

    Dear Zipline Maintainers,

    i'm very happy to write to you :) after installing all this packages:

    alembic conda-forge/noarch::alembic-1.8.1-pyhd8ed1ab_0 bcolz-zipline ml4t/win-64::bcolz-zipline-1.2.4-py38he6999da_0 blas pkgs/main/win-64::blas-1.0-mkl blosc conda-forge/win-64::blosc-1.21.1-h74325e0_3 bottleneck conda-forge/win-64::bottleneck-1.3.5-py38hbdcd294_0 brotlipy conda-forge/win-64::brotlipy-0.7.0-py38h294d835_1004 bzip2 conda-forge/win-64::bzip2-1.0.8-h8ffe710_4 ca-certificates conda-forge/win-64::ca-certificates-2022.6.15-h5b45459_0 cached-property conda-forge/noarch::cached-property-1.5.2-hd8ed1ab_1 cached_property conda-forge/noarch::cached_property-1.5.2-pyha770c72_1 certifi conda-forge/win-64::certifi-2022.6.15-py38haa244fe_0 cffi conda-forge/win-64::cffi-1.15.1-py38hd8c33c5_0 charset-normalizer conda-forge/noarch::charset-normalizer-2.1.0-pyhd8ed1ab_0 click conda-forge/win-64::click-8.1.3-py38haa244fe_0 colorama conda-forge/noarch::colorama-0.4.5-pyhd8ed1ab_0 cryptography conda-forge/win-64::cryptography-37.0.4-py38hb7941b4_0 empyrical-reloaded ml4t/win-64::empyrical-reloaded-0.5.8-py38_0 exchange-calendars ml4t/win-64::exchange-calendars-3.3-py38_0 greenlet conda-forge/win-64::greenlet-1.1.2-py38h885f38d_2 h5py conda-forge/win-64::h5py-3.7.0-nompi_py38hc790250_100 hdf5 conda-forge/win-64::hdf5-1.12.1-nompi_h2a0e4a3_104 idna conda-forge/noarch::idna-3.3-pyhd8ed1ab_0 importlib-metadata conda-forge/win-64::importlib-metadata-4.11.4-py38haa244fe_0 importlib_resourc~ conda-forge/noarch::importlib_resources-5.9.0-pyhd8ed1ab_0 intel-openmp conda-forge/win-64::intel-openmp-2022.1.0-h57928b3_3787 intervaltree conda-forge/noarch::intervaltree-3.0.2-py_0 iso3166 conda-forge/noarch::iso3166-2.1.1-pyhd8ed1ab_0 iso4217 conda-forge/noarch::iso4217-1.9.20220401-pyhd8ed1ab_0 korean_lunar_cale~ conda-forge/noarch::korean_lunar_calendar-0.2.1-pyh9f0ad1d_0 krb5 conda-forge/win-64::krb5-1.19.3-h1176d77_0 libblas conda-forge/win-64::libblas-3.9.0-12_win64_mkl libcblas conda-forge/win-64::libcblas-3.9.0-12_win64_mkl libcurl conda-forge/win-64::libcurl-7.83.1-h789b8ee_0 libffi conda-forge/win-64::libffi-3.4.2-h8ffe710_5 libiconv conda-forge/win-64::libiconv-1.16-he774522_0 liblapack conda-forge/win-64::liblapack-3.9.0-12_win64_mkl libssh2 conda-forge/win-64::libssh2-1.10.0-h680486a_2 libxml2 conda-forge/win-64::libxml2-2.9.14-hf5bbc77_3 libxslt conda-forge/win-64::libxslt-1.1.35-h34f844d_0 libzlib conda-forge/win-64::libzlib-1.2.12-h8ffe710_2 logbook ml4t/win-64::logbook-1.5.3-py38_0 lru-dict conda-forge/win-64::lru-dict-1.1.8-py38h294d835_0 lxml conda-forge/win-64::lxml-4.9.1-py38h294d835_0 lz4-c conda-forge/win-64::lz4-c-1.9.3-h8ffe710_1 m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6 m2w64-gcc-libs conda-forge/win-64::m2w64-gcc-libs-5.3.0-7 m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7 m2w64-gmp conda-forge/win-64::m2w64-gmp-6.1.0-2 m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2 mako conda-forge/noarch::mako-1.2.1-pyhd8ed1ab_0 markupsafe conda-forge/win-64::markupsafe-2.1.1-py38h294d835_1 mkl conda-forge/win-64::mkl-2021.4.0-h0e2418a_729 mkl-service conda-forge/win-64::mkl-service-2.4.0-py38h4f8af0f_0 msys2-conda-epoch conda-forge/win-64::msys2-conda-epoch-20160418-1 multipledispatch conda-forge/noarch::multipledispatch-0.6.0-py_0 multitasking conda-forge/noarch::multitasking-0.0.9-pyhd8ed1ab_0 networkx conda-forge/noarch::networkx-2.8.5-pyhd8ed1ab_0 numexpr pkgs/main/win-64::numexpr-2.8.3-py38hb80d3ca_0 numpy conda-forge/win-64::numpy-1.23.1-py38h223ccf5_0 openssl conda-forge/win-64::openssl-1.1.1q-h8ffe710_0 packaging conda-forge/noarch::packaging-21.3-pyhd8ed1ab_0 pandas conda-forge/win-64::pandas-1.4.3-py38hcc40339_0 pandas-datareader conda-forge/noarch::pandas-datareader-0.10.0-pyh6c4a22f_0 patsy conda-forge/noarch::patsy-0.5.2-pyhd8ed1ab_0 pip conda-forge/noarch::pip-22.2.1-pyhd8ed1ab_0 pycparser conda-forge/noarch::pycparser-2.21-pyhd8ed1ab_0 pyluach conda-forge/noarch::pyluach-2.0.0-pyhd8ed1ab_0 pyopenssl conda-forge/noarch::pyopenssl-22.0.0-pyhd8ed1ab_0 pyparsing conda-forge/noarch::pyparsing-3.0.9-pyhd8ed1ab_0 pysocks conda-forge/win-64::pysocks-1.7.1-py38haa244fe_5 pytables conda-forge/win-64::pytables-3.7.0-py38h7deab4d_0 python conda-forge/win-64::python-3.8.13-h9a09f29_0_cpython python-dateutil conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0 python-interface conda-forge/noarch::python-interface-1.6.0-py_0 python_abi conda-forge/win-64::python_abi-3.8-2_cp38 pytz conda-forge/noarch::pytz-2022.1-pyhd8ed1ab_0 requests conda-forge/noarch::requests-2.28.1-pyhd8ed1ab_0 scipy conda-forge/win-64::scipy-1.8.1-py38h4990095_2 setuptools conda-forge/win-64::setuptools-63.2.0-py38haa244fe_0 six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0 snappy conda-forge/win-64::snappy-1.1.9-h82413e6_1 sortedcontainers conda-forge/noarch::sortedcontainers-2.4.0-pyhd8ed1ab_0 sqlalchemy conda-forge/win-64::sqlalchemy-1.4.39-py38h294d835_0 sqlite conda-forge/win-64::sqlite-3.39.2-h8ffe710_0 statsmodels conda-forge/win-64::statsmodels-0.13.2-py38hbdcd294_0 ta-lib ml4t/win-64::ta-lib-0.4.21-py38hb572761_0 tbb conda-forge/win-64::tbb-2021.5.0-h2d74725_1 tk conda-forge/win-64::tk-8.6.12-h8ffe710_0 toolz conda-forge/noarch::toolz-0.12.0-pyhd8ed1ab_0 trading-calendars conda-forge/noarch::trading-calendars-2.1.1-pyhd3deb0d_0 ucrt conda-forge/win-64::ucrt-10.0.20348.0-h57928b3_0 urllib3 conda-forge/noarch::urllib3-1.26.11-pyhd8ed1ab_0 vc conda-forge/win-64::vc-14.2-hb210afc_6 vs2015_runtime conda-forge/win-64::vs2015_runtime-14.29.30037-h902a5da_6 wheel conda-forge/noarch::wheel-0.37.1-pyhd8ed1ab_0 win_inet_pton conda-forge/win-64::win_inet_pton-1.1.0-py38haa244fe_4 xz conda-forge/win-64::xz-5.2.5-h62dcd97_1 yfinance ml4t/noarch::yfinance-0.1.63-py_0 zipline-reloaded ml4t/win-64::zipline-reloaded-2.2.0-py38he6999da_0 zipp conda-forge/noarch::zipp-3.8.0-pyhd8ed1ab_0 zlib conda-forge/win-64::zlib-1.2.12-h8ffe710_2 zstd conda-forge/win-64::zstd-1.5.2-h6255e5f_2

    Proceed ([y]/n)? y

    #################### this is my error! ################################""

    (z_39) C:\Users\GHALI>python Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 05:59:45) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

    from zipline.api import order_target, record, symbol Traceback (most recent call last): File "", line 1, in File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline_init_.py", line 29, in from .utils.run_algo import run_algorithm File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\utils\run_algo.py", line 24, in from zipline.pipeline.data import USEquityPricing File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\pipeline_init_.py", line 1, in from .classifiers import Classifier, CustomClassifier File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\pipeline\classifiers_init_.py", line 1, in from .classifier import ( File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\pipeline\classifiers\classifier.py", line 22, in from zipline.pipeline.term import ComputableTerm File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\pipeline\term.py", line 45, in from .domain import Domain, GENERIC, infer_domain File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\pipeline\domain.py", line 27, in from zipline.country import CountryCode File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\country.py", line 10, in class CountryCode(object): File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\country.py", line 55, in CountryCode TURKEY = code("TURKEY") File "C:\Users\GHALI\anaconda3\envs\z_39\lib\site-packages\zipline\country.py", line 7, in code return countries_by_name[name].alpha2 KeyError: 'TURKEY'

    opened by ghaliahmed 4
  • remove trailing p from mock dependency version in pyproject toml

    remove trailing p from mock dependency version in pyproject toml

    Hi,

    I get an error when trying to install zipline-reloaded v2.3.0. Poetry says this is due to the version string for mock.

    This is the main part of the traceback:

    #14 132.5         /tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
    #14 132.5           warnings.warn(msg, _BetaConfiguration)
    #14 132.5         configuration error: `project.optional-dependencies.{data__optionaldependencies_key}[{data__optionaldependencies_val_x}]` must be pep508
    #14 132.5         DESCRIPTION:
    #14 132.5             Project dependency specification according to PEP 508
    #14 132.5
    #14 132.5         GIVEN VALUE:
    #14 132.5             "mock >=2.0.0p"
    #14 132.5
    #14 132.5         OFFENDING RULE: 'format'
    #14 132.5
    #14 132.5         DEFINITION:
    #14 132.5             {
    #14 132.5                 "$id": "#/definitions/dependency",
    #14 132.5                 "title": "Dependency",
    #14 132.5                 "type": "string",
    #14 132.5                 "format": "pep508"
    #14 132.5             }
    #14 132.5         Traceback (most recent call last):
    #14 132.5           File "/tmp/tmpx7u2hbu3_in_process.py", line 351, in <module>
    #14 132.5             main()
    #14 132.5           File "/tmp/tmpx7u2hbu3_in_process.py", line 333, in main
    #14 132.5             json_out['return_val'] = hook(**hook_input['kwargs'])
    #14 132.5           File "/tmp/tmpx7u2hbu3_in_process.py", line 118, in get_requires_for_build_wheel
    #14 132.5             return hook(config_settings)
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
    #14 132.5             return self._get_build_requires(config_settings, requirements=['wheel'])
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
    #14 132.5             self.run_setup()
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
    #14 132.5             exec(code, locals())
    #14 132.5           File "<string>", line 106, in <module>
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
    #14 132.5             return distutils.core.setup(**attrs)
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 159, in setup
    #14 132.5             dist.parse_config_files()
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 867, in parse_config_files
    [tool.poetry]
    #14 132.5             pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py", line 62, in apply_configuration
    #14 132.5             config = read_configuration(filepath, True, ignore_option_errors, dist)
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py", line 126, in read_configuration
    #14 132.5             validate(subset, filepath)
    #14 132.5           File "/tmp/pip-build-env-oglm4unr/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py", line 51, in validate
    #14 132.5             raise ValueError(f"{error}\n{summary}") from None
    #14 132.5         ValueError: invalid pyproject.toml config: `project.optional-dependencies.{data__optionaldependencies_key}[{data__optionaldependencies_val_x}]`.
    #14 132.5         configuration error: `project.optional-dependencies.{data__optionaldependencies_key}[{data__optionaldependencies_val_x}]` must be pep508
    #14 132.5         [end of output]
    

    I am not aware of using p in version strings and since p is next to 0 on the keyboard, my suspicion is typo. Might be missing something though

    There's no lock file so I haven't built/updated one. I tried looking at the contributing guidelines but the link didn't take me away from CONTRIBUTING.rst. Let me know if there are other requirements for this pull request

    opened by joshkarlin 0
  • Bump pypa/cibuildwheel from 2.11.2 to 2.11.4

    Bump pypa/cibuildwheel from 2.11.2 to 2.11.4

    Bumps pypa/cibuildwheel from 2.11.2 to 2.11.4.

    Release notes

    Sourced from pypa/cibuildwheel's releases.

    v2.11.4

    • 🐛 Fix a bug that caused missing wheels on Windows when a test was skipped using CIBW_TEST_SKIP (#1377)
    • 🛠 Updates CPython 3.11 to 3.11.1 (#1371)
    • 🛠 Updates PyPy 3.7 to 3.7.10, except on macOS which remains on 7.3.9 due to a bug. (#1371)
    • 📚 Added a reference to abi3audit to the docs (#1347)

    v2.11.3

    • ✨ Improves the 'build options' log output that's printed at the start of each run (#1352)
    • ✨ Added a friendly error message to a common misconfiguration of the CIBW_TEST_COMMAND option - not specifying path using the {project} placeholder (#1336)
    • 🛠 The GitHub Action now uses Powershell on Windows to avoid occasional incompabilities with bash (#1346)
    Changelog

    Sourced from pypa/cibuildwheel's changelog.

    v2.11.4

    24 Dec 2022

    • 🐛 Fix a bug that caused missing wheels on Windows when a test was skipped using CIBW_TEST_SKIP (#1377)
    • 🛠 Updates CPython 3.11 to 3.11.1 (#1371)
    • 🛠 Updates PyPy to 7.3.10, except on macOS which remains on 7.3.9 due to a bug on that platform. (#1371)
    • 📚 Added a reference to abi3audit to the docs (#1347)

    v2.11.3

    5 Dec 2022

    • ✨ Improves the 'build options' log output that's printed at the start of each run (#1352)
    • ✨ Added a friendly error message to a common misconfiguration of the CIBW_TEST_COMMAND option - not specifying path using the {project} placeholder (#1336)
    • 🛠 The GitHub Action now uses Powershell on Windows to avoid occasional incompabilities with bash (#1346)
    Commits
    • 27fc88e Bump version: v2.11.4
    • a7e9ece Merge pull request #1371 from pypa/update-dependencies-pr
    • b9a3ed8 Update cibuildwheel/resources/build-platforms.toml
    • 3dcc2ff fix: not skipping the tests stops the copy (Windows ARM) (#1377)
    • 1c9ec76 Merge pull request #1378 from pypa/henryiii-patch-3
    • 22b433d Merge pull request #1379 from pypa/pre-commit-ci-update-config
    • 98fdf8c [pre-commit.ci] pre-commit autoupdate
    • cefc5a5 Update dependencies
    • e53253d ci: move to ubuntu 20
    • e9ecc65 [pre-commit.ci] pre-commit autoupdate (#1374)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Import Error LOAD while ingesting custom data in zipline

    Import Error LOAD while ingesting custom data in zipline

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: windows11
    • Python Version: python 3.8
    • Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
    • How did you install Zipline: ml4t
    • Python packages: $ pip freeze or $ conda list
    • alabaster 0.7.12 pyhd3eb1b0_0 alembic 1.8.1 pyhd8ed1ab_0 conda-forge anyio 3.5.0 py38haa95532_0 argon2-cffi 21.3.0 pyhd3eb1b0_0 argon2-cffi-bindings 21.2.0 py38h2bbff1b_0 arrow 1.2.3 py38haa95532_0 astroid 2.11.7 py38haa95532_0 atomicwrites 1.4.0 py_0 attrs 22.1.0 py38haa95532_0 autopep8 1.6.0 pyhd3eb1b0_1 babel 2.9.1 pyhd3eb1b0_0 backcall 0.2.0 pyhd3eb1b0_0 bcolz-zipline 1.2.6 py38he6999da_0 ml4t bcrypt 3.2.0 py38h2bbff1b_1 beautifulsoup4 4.11.1 py38haa95532_0 binaryornot 0.4.4 pyhd3eb1b0_1 black 22.6.0 py38haa95532_0 blas 1.0 mkl bleach 4.1.0 pyhd3eb1b0_0 blosc 1.21.1 hcbbf2c4_0 conda-forge bottleneck 1.3.5 py38hbdcd294_0 conda-forge brotli 1.0.9 h2bbff1b_7 brotli-bin 1.0.9 h2bbff1b_7 brotlipy 0.7.0 py38h294d835_1004 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2022.10.11 haa95532_0 certifi 2022.9.24 py38haa95532_0 cffi 1.15.1 py38hd8c33c5_0 conda-forge chardet 4.0.0 py38haa95532_1003 charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge click 8.1.3 win_pyhd8ed1ab_2 conda-forge cloudpickle 2.0.0 pyhd3eb1b0_0 colorama 0.4.6 pyhd8ed1ab_0 conda-forge console_shortcut 0.1.1 4 cookiecutter 1.7.3 pyhd3eb1b0_0 cryptography 3.4.8 py38hb7941b4_1 conda-forge cycler 0.11.0 pyhd3eb1b0_0 debugpy 1.5.1 py38hd77b12b_0 decorator 5.1.1 pyhd3eb1b0_0 defusedxml 0.7.1 pyhd3eb1b0_0 diff-match-patch 20200713 pyhd3eb1b0_0 dill 0.3.6 py38haa95532_0 docutils 0.18.1 py38haa95532_3 empyrical-reloaded 0.5.8 py38_0 ml4t entrypoints 0.4 py38haa95532_0 exchange-calendars 3.3 py38_0 ml4t flake8 4.0.1 pyhd3eb1b0_1 fonttools 4.25.0 pyhd3eb1b0_0 freetype 2.12.1 ha860e81_0 glib 2.69.1 h5dc1a3c_2 greenlet 1.1.1 py38hd77b12b_0 gst-plugins-base 1.18.5 h9e645db_0 gstreamer 1.18.5 hd78058f_0 h5py 2.10.0 py38h5e291fa_0 hdf5 1.10.4 nompi_hcc15c50_1106 conda-forge icu 58.2 ha925a31_3 idna 3.4 pyhd8ed1ab_0 conda-forge imagesize 1.4.1 py38haa95532_0 importlib-metadata 4.11.3 py38haa95532_0 importlib_metadata 4.11.3 hd3eb1b0_0 importlib_resources 5.10.0 pyhd8ed1ab_0 conda-forge inflection 0.5.1 py38haa95532_0 intel-openmp 2022.1.0 h57928b3_3787 conda-forge intervaltree 3.0.2 py_0 conda-forge ipykernel 6.15.2 py38haa95532_0 ipython 7.31.1 py38haa95532_1 ipython_genutils 0.2.0 pyhd3eb1b0_1 iso3166 2.0.2 pypi_0 pypi iso4217 1.9.20220401 pyhd8ed1ab_0 conda-forge isort 5.9.3 pyhd3eb1b0_0 jedi 0.18.1 py38haa95532_1 jellyfish 0.9.0 py38h2bbff1b_0 jinja2 3.1.2 py38haa95532_0 jinja2-time 0.2.0 pyhd3eb1b0_3 jpeg 9e h2bbff1b_0 jsonschema 4.16.0 py38haa95532_0 jupyter_client 7.4.7 py38haa95532_0 jupyter_core 4.11.2 py38haa95532_0 jupyter_server 1.18.1 py38haa95532_0 jupyterlab_pygments 0.1.2 py_0 keyring 23.4.0 py38haa95532_0 kiwisolver 1.4.2 py38hd77b12b_0 korean_lunar_calendar 0.3.1 pyhd8ed1ab_0 conda-forge lazy-object-proxy 1.6.0 py38h2bbff1b_0 lerc 3.0 hd77b12b_0 libblas 3.9.0 12_win64_mkl conda-forge libbrotlicommon 1.0.9 h2bbff1b_7 libbrotlidec 1.0.9 h2bbff1b_7 libbrotlienc 1.0.9 h2bbff1b_7 libcblas 3.9.0 12_win64_mkl conda-forge libclang 12.0.0 default_h627e005_2 libdeflate 1.8 h2bbff1b_5 libffi 3.4.2 hd77b12b_6 libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 12_win64_mkl conda-forge libogg 1.3.5 h2bbff1b_1 libpng 1.6.37 h2a8f88b_0 libsodium 1.0.18 h62dcd97_0 libspatialindex 1.9.3 h6c2663c_0 libtiff 4.4.0 h8a3f274_2 libvorbis 1.3.7 he774522_0 libwebp 1.2.4 h2bbff1b_0 libwebp-base 1.2.4 h2bbff1b_0 libxml2 2.9.14 h0ad7f3c_0 libxslt 1.1.35 h2bbff1b_0 logbook 1.5.3 py38_0 ml4t lru-dict 1.1.8 py38h294d835_0 conda-forge lxml 4.9.1 py38h294d835_0 conda-forge lz4-c 1.9.3 h2bbff1b_1 lzo 2.10 he774522_1000 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge mako 1.2.4 pyhd8ed1ab_0 conda-forge markupsafe 2.1.1 py38h294d835_1 conda-forge matplotlib 3.5.3 py38haa95532_0 matplotlib-base 3.5.3 py38hd77b12b_0 matplotlib-inline 0.1.6 py38haa95532_0 mccabe 0.7.0 pyhd3eb1b0_0 mistune 0.8.4 py38he774522_1000 mkl 2021.4.0 h0e2418a_729 conda-forge mkl-service 2.4.0 py38h4f8af0f_0 conda-forge mock 4.0.3 pyhd8ed1ab_4 conda-forge msys2-conda-epoch 20160418 1 conda-forge multipledispatch 0.6.0 py_0 conda-forge multitasking 0.0.9 pyhd8ed1ab_0 conda-forge munkres 1.1.4 py_0 mypy_extensions 0.4.3 py38haa95532_1 nb_conda 2.2.1 py38_1 nb_conda_kernels 2.3.1 py38haa95532_0 nbclassic 0.4.8 py38haa95532_0 nbclient 0.5.13 py38haa95532_0 nbconvert 6.5.4 py38haa95532_0 nbformat 5.5.0 py38haa95532_0 nest-asyncio 1.5.5 py38haa95532_0 networkx 2.8.8 pyhd8ed1ab_0 conda-forge notebook 6.5.2 py38haa95532_0 notebook-shim 0.2.2 py38haa95532_0 numexpr 2.8.4 py38h5b0cc5e_0 numpy 1.22.3 py38h1d2777f_2 conda-forge numpydoc 1.5.0 py38haa95532_0 openssl 1.1.1s h2bbff1b_0 packaging 21.3 pyhd8ed1ab_0 conda-forge pandas 1.4.4 py38hd77b12b_0 pandas-datareader 0.10.0 pyh6c4a22f_0 conda-forge pandocfilters 1.5.0 pyhd3eb1b0_0 paramiko 2.8.1 pyhd3eb1b0_0 parso 0.8.3 pyhd3eb1b0_0 pathspec 0.9.0 py38haa95532_0 patsy 0.5.3 pyhd8ed1ab_0 conda-forge pcre 8.45 hd77b12b_0 pexpect 4.8.0 pyhd3eb1b0_3 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 9.2.0 py38hdc2b20a_1 pip 22.2.2 py38haa95532_0 pkgutil-resolve-name 1.3.10 py38haa95532_0 platformdirs 2.5.2 py38haa95532_0 pluggy 1.0.0 py38haa95532_1 ply 3.11 py38_0 powershell_shortcut 0.0.1 3 poyo 0.5.0 pyhd3eb1b0_0 prometheus_client 0.14.1 py38haa95532_0 prompt-toolkit 3.0.20 pyhd3eb1b0_0 psutil 5.9.0 py38h2bbff1b_0 ptyprocess 0.7.0 pyhd3eb1b0_2 pycodestyle 2.8.0 pyhd3eb1b0_0 pycparser 2.21 pyhd8ed1ab_0 conda-forge pydocstyle 6.1.1 pyhd3eb1b0_0 pyflakes 2.4.0 pyhd3eb1b0_0 pygments 2.11.2 pyhd3eb1b0_0 pylint 2.14.5 py38haa95532_0 pyls-spyder 0.4.0 pyhd3eb1b0_0 pyluach 2.0.2 pyhd8ed1ab_0 conda-forge pynacl 1.5.0 py38h8cc25b3_0 pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge pyqt 5.15.7 py38hd77b12b_0 pyqt5-sip 12.11.0 py38hd77b12b_0 pyqtwebengine 5.15.7 py38hd77b12b_0 pyreadline 2.1 py38haa244fe_1007 conda-forge pyrsistent 0.18.0 py38h196d8e1_0 pysocks 1.7.1 pyh0701188_6 conda-forge pytables 3.6.1 py38ha5be198_0 python 3.8.0 hff0d562_2 python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.16.2 py38haa95532_0 python-interface 1.6.0 py_0 conda-forge python-lsp-black 1.2.1 py38haa95532_0 python-lsp-jsonrpc 1.0.0 pyhd3eb1b0_0 python-lsp-server 1.5.0 py38haa95532_0 python-slugify 5.0.2 pyhd3eb1b0_0 python_abi 3.8 2_cp38 conda-forge pytz 2022.6 pyhd8ed1ab_0 conda-forge pywin32 302 py38h2bbff1b_2 pywin32-ctypes 0.2.0 py38_1000 pywinpty 2.0.2 py38h5da7b33_0 pyyaml 6.0 py38h2bbff1b_1 pyzmq 23.2.0 py38hd77b12b_0 qdarkstyle 3.0.2 pyhd3eb1b0_0 qstylizer 0.1.10 pyhd3eb1b0_0 qt-main 5.15.2 he8e5bd7_7 qt-webengine 5.15.9 hb9a9bb5_4 qtawesome 1.0.3 pyhd3eb1b0_0 qtconsole 5.3.2 py38haa95532_0 qtpy 2.2.0 py38haa95532_0 qtwebkit 5.212 h3ad3cdb_4 requests 2.28.1 pyhd8ed1ab_1 conda-forge rope 0.22.0 pyhd3eb1b0_0 rtree 0.9.7 py38h2eaa2aa_1 scipy 1.8.1 py38h4990095_2 conda-forge send2trash 1.8.0 pyhd3eb1b0_1 setuptools 65.5.0 py38haa95532_0 sip 6.6.2 py38hd77b12b_0 six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.9 h82413e6_1 conda-forge sniffio 1.2.0 py38haa95532_1 snowballstemmer 2.2.0 pyhd3eb1b0_0 sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.2.post1 py38haa95532_0 sphinx 5.0.2 py38haa95532_0 sphinxcontrib-applehelp 1.0.2 pyhd3eb1b0_0 sphinxcontrib-devhelp 1.0.2 pyhd3eb1b0_0 sphinxcontrib-htmlhelp 2.0.0 pyhd3eb1b0_0 sphinxcontrib-jsmath 1.0.1 pyhd3eb1b0_0 sphinxcontrib-qthelp 1.0.3 pyhd3eb1b0_0 sphinxcontrib-serializinghtml 1.1.5 pyhd3eb1b0_0 spyder 5.3.3 py38haa95532_0 spyder-kernels 2.3.3 py38haa95532_0 sqlalchemy 1.4.13 py38h294d835_0 conda-forge sqlite 3.40.0 h2bbff1b_0 statsmodels 0.13.2 py38h2bbff1b_0 ta-lib 0.4.25 py38h5685391_0 ml4t tbb 2021.6.0 h59b6b97_0 terminado 0.13.1 py38haa95532_0 text-unidecode 1.3 pyhd3eb1b0_0 textdistance 4.2.1 pyhd3eb1b0_0 three-merge 0.1.1 pyhd3eb1b0_0 tinycss 0.4 pyhd3eb1b0_1002 tinycss2 1.2.1 py38haa95532_0 tk 8.6.12 h2bbff1b_0 toml 0.10.2 pyhd3eb1b0_0 tomli 2.0.1 py38haa95532_0 tomlkit 0.11.1 py38haa95532_0 toolz 0.12.0 pyhd8ed1ab_0 conda-forge tornado 6.2 py38h2bbff1b_0 trading-calendars 2.1.1 pyhd3deb0d_0 conda-forge traitlets 5.1.1 pyhd3eb1b0_0 typing-extensions 4.3.0 py38haa95532_0 typing_extensions 4.3.0 py38haa95532_0 ujson 5.4.0 py38hd77b12b_0 unidecode 1.2.0 pyhd3eb1b0_0 urllib3 1.26.13 pyhd8ed1ab_0 conda-forge vc 14.2 h21ff451_1 vs2015_runtime 14.27.29016 h5e58377_2 watchdog 2.1.6 py38haa95532_0 wcwidth 0.2.5 pyhd3eb1b0_0 webencodings 0.5.1 py38_1 websocket-client 0.58.0 py38haa95532_4 whatthepatch 1.0.2 py38haa95532_0 wheel 0.37.1 pyhd3eb1b0_0 win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge wincertstore 0.2 py38haa95532_2 winpty 0.4.3 4 wrapt 1.14.1 py38h2bbff1b_0 xz 5.2.6 h8cc25b3_0 yaml 0.2.5 he774522_0 yapf 0.31.0 pyhd3eb1b0_0 yfinance 0.1.63 py_0 ml4t zeromq 4.3.4 hd77b12b_0 zipline-reloaded 2.2.0 py38he6999da_0 ml4t zipp 3.11.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 h8cc25b3_0 zstd 1.5.2 h19a0ad4_0

    Now that you know a little about me, let me tell you about the issue I am having:

    • I am facing error while ingesting data bundle.
    • this is how my extension.py looks like : import pandas as pd

    from zipline.data.bundles import register from zipline.data.bundles.csvdir import csvdir_equities

    start_session = pd.Timestamp('2017-1-2', tz='utc') end_session = pd.Timestamp('2022-6-30', tz='utc')

    register the bundle

    register( 'abcdata',
    csvdir_equities(['daily'],"C:\Users\krkoo\anaconda3\envs\env_zip\Lib\site-packages\zipline\data\bundles\zipline_form_data"), calendar_name='XBOM',
    start_session=start_session, end_session=end_session )

    when i run this command in cmd: zipline ingest -b abcdata I get error as follows: Traceback (most recent call last): File "C:\Users\krkoo\anaconda3\envs\env_zip\Scripts\zipline-script.py", line 6, in from zipline.main import main File "C:\Users\krkoo\anaconda3\envs\env_zip\lib\site-packages\zipline_init.py", line 29, in from .utils.run_algo import run_algorithm File "C:\Users\krkoo\anaconda3\envs\env_zip\lib\site-packages\zipline\utils\run_algo.py", line 28, in from zipline.extensions import load ImportError: cannot import name 'load' from 'zipline.extensions' (C:\Users\krkoo\anaconda3\envs\env_zip\lib\site-packages\zipline\extensions.py)_

    What steps have you taken to resolve this already?

    I have tried tweaking with extions file and csvdir file but nothing is solving this issue..

    Sincerely, Krishna Rachh

    Waiting for a reply thanks!!

    opened by KrishnaRachh 0
  • Market on Open

    Market on Open

    Just a friendly suggestion:

    For some EOD models, it makes sense to place orders as 'market on open', rather than the default Zipline logic of 'market on close'. I quite simple really and I've modded my own setup for this, and I thought might be of interest to the community.

    The 'market on close' logic is currently hard coded in the slippage.py file, and I suppose the reason for that is that Quantopian assumed intraday, minute data.

    The simple solution would be to add a field input argument to the constructors in the slippage.py file. Quick, easy and gets the job done.

    opened by AndreasClenow 0
  • OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-09-21 00:00:00

    OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-09-21 00:00:00

    Dear Zipline Maintainers,

    Before I tell you about my issue, let me describe my environment:

    Environment

    • Operating System: (Windows Version or $ uname --all)
    • Python Version: $ python --version
    • Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
    • How did you install Zipline: (pip, conda, or other (please explain))
    • Python packages: $ pip freeze or $ conda list

    Now that you know a little about me, let me tell you about the issue I am having: I ingest my chinese stock data and use it to backtesting with pipeline factor.But when i use run_algorithm there is the error: OutOfBoundsDatetime Traceback (most recent call last) ~\AppData\Local\Temp\tmp24i55k5_\ipykernel_13180\3170537094.py in 7 data_frequency='daily', 8 bundle='cnstock', ----> 9 custom_loader=signal_loader)# need to modify zipline 10 11 print('Duration: {:.2f}s'.format(time() - start))

    c:\Users\zjlqaq\anaconda3\envs\zipline_env2\lib\site-packages\zipline\utils\run_algo.py in run_algorithm(start, end, initialize, capital_base, handle_data, before_trading_start, analyze, data_frequency, bundle, bundle_timestamp, trading_calendar, metrics_set, benchmark_returns, default_extension, extensions, strict_extensions, environ, custom_loader, blotter) 417 blotter=blotter, 418 custom_loader=custom_loader, --> 419 benchmark_spec=benchmark_spec, 420 ) 421

    c:\Users\zjlqaq\anaconda3\envs\zipline_env2\lib\site-packages\zipline\utils\run_algo.py in _run(handle_data, initialize, before_trading_start, analyze, algofile, algotext, defines, data_frequency, capital_base, bundle, bundle_timestamp, start, end, output, trading_calendar, print_algo, metrics_set, local_namespace, environ, blotter, custom_loader, benchmark_spec) 223 else { 224 "algo_filename": getattr(algofile, "name", ""), --> 225 "script": algotext, 226 }, 227 ).run()

    c:\Users\zjlqaq\anaconda3\envs\zipline_env2\lib\site-packages\zipline\algorithm.py in run(self, data_portal) 621 try: ... c:\Users\zjlqaq\anaconda3\envs\zipline_env2\lib\site-packages\pandas_libs\tslibs\conversion.pyx in pandas._libs.tslibs.conversion.convert_datetime_to_tsobject()

    c:\Users\zjlqaq\anaconda3\envs\zipline_env2\lib\site-packages\pandas_libs\tslibs\np_datetime.pyx in pandas._libs.tslibs.np_datetime.check_dts_bounds()

    OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-09-21 00:00:00

    I find my raw data have no timestamp: 1677-09-21 00:00:00 and error timestamp,and i can't find the error.If anyone can solve or there is any api to see my bundle data timestamp?

    Here is how you can reproduce this issue on your machine:

    opened by zhangjianliang1 1
Releases(2.2)
  • 2.2(Oct 29, 2021)

  • 2.1.1(Sep 8, 2021)

    The release simplifies the code by removing elements that are no longer necessary, addresses a few issues and improves the automatic build and test GHA workflows.

    Pandas 1.3+ causes issues with trading-calendars; while we work out migration to the more actively maintained exchange_calendars, pandas is temporarily limited to version <=1.2.5.

    Big shout-out to @MBounouar who made quite a few very useful contributions, namely:

    • Migrate from nosetest to pytest (#9, #15 )
    • Apply patch for futures backtesting (#3)
    • Various revisions of the Cython extensions to facilitate maintenance and enhancements going forward (#46, #49)
    • Address warnings and other maintenance issues.

    In addition, there are several improvements to the automatic test and build process (#47, #48, #50, #51, #52).

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0rc4(Mar 29, 2021)

    Highlights

    This release updates Zipline to be compatible with Python >= 3.7 as well as the current versions of relevant NumFOCUS libraries like Pandas, scikit-learn, and others.

    • Conda packages for Zipline and key dependencies Bcolz and TA-Lib are now available for Python 3.7-3.9 on the ml4t Anaconda channel.
    • Binary wheels are available on PyPI for Linux ( Python 3.7-3.9) and MacOSx (3.7 and 3.8).

    As part of the update, the BlazeLoader functionality was removed. It was built on the Blaze Ecosystem. Unfortunately, the three relevant projects (Blaze, Odo, and datashape have received limited support over the last several years.

    Other updates include:

    • A new release for Bcolz which has been marked unmaintained since September 2020 by the author. The new release updates the underlying c-blosc library from version 1.14 to the latest 1.21.0. There are also conda packages for Bcolz (see links above).
    • Networkx - used by Zipline to process the Pipeline Graph - now uses the better performing version 2.0.
    • Conda packages for TA-Lib version 0.4.19.

    This new release also makes it easier to load custom data sources into a Pipeline (such as the predictions of an ML model) when backtesting. See the relevant examples in the Github repo of the book Machine Learning for Trading,, such as these ones.

    Enhancements

    • custom_loader() for custom Pipeline data
    • compatibility with the latest versions of Pandas, scikit-learn, and other relevant libraries.

    Bug Fixes

    • Numerous tests updates to accommodate recent Python and dependency versions.

    Performance

    • The latest blosc library may improve compression and I/O performance.

    Maintenance and Refactorings

    • Removed Python 2 support

    Build

    • All builds consolidated on GitHub Actions CI

    Documentation

    • Expanded with additional information on Pipeline and related DataLoaders
    Source code(tar.gz)
    Source code(zip)
Algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex)

Algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex)

null 172 Dec 21, 2022
Gnat - GNAT is NOT Algorithmic Trading

GNAT GNAT is NOT Algorithmic Trading! GNAT is a financial tool with two goals in

Sher Shah 2 Jan 9, 2022
A simple library for implementing common design patterns.

PyPattyrn from pypattyrn.creational.singleton import Singleton class DummyClass(object, metaclass=Singleton): # DummyClass is now a Singleton!

null 1.7k Jan 1, 2023
zoofs is a Python library for performing feature selection using an variety of nature inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics based to Evolutionary. It's easy to use ,flexible and powerful tool to reduce your feature size.

zoofs is a Python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.

Jaswinder Singh 168 Dec 30, 2022
A Python library for simulating finite automata, pushdown automata, and Turing machines

Automata Copyright 2016-2021 Caleb Evans Released under the MIT license Automata is a Python 3 library which implements the structures and algorithms

Caleb Evans 219 Dec 12, 2022
Minimal pure Python library for working with little-endian list representation of bit strings.

bitlist Minimal Python library for working with bit vectors natively. Purpose This library allows programmers to work with a native representation of

Andrei Lapets 0 Jul 25, 2022
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 2, 2023
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 7, 2023
Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI

Cryptocurrency Trading Bot - A trading bot to automate cryptocurrency trading strategies using Python, equipped with a basic GUI. Used REST and WebSocket API to connect to two of the most popular crypto exchanges in the world.

Francis 8 Sep 15, 2022
An Algorithmic Trading Library for Crypto-Assets in Python

Service Master Develop CI Badge Catalyst is an algorithmic trading library for crypto-assets written in Python. It allows trading strategies to be eas

Enigma 2.4k Jan 5, 2023
Python Algorithmic Trading Library

PyAlgoTrade PyAlgoTrade is an event driven algorithmic trading Python library. Although the initial focus was on backtesting, paper trading is now pos

Gabriel Becedillas 3.9k Jan 1, 2023
Common financial risk and performance metrics. Used by zipline and pyfolio.

empyrical Common financial risk metrics. Table of Contents Installation Usage Support Contributing Testing Installation pip install empyrical Usage S

Quantopian, Inc. 1k Dec 26, 2022
Algorithmic trading using machine learning.

Algorithmic Trading This machine learning algorithm was built using Python 3 and scikit-learn with a Decision Tree Classifier. The program gathers sto

Sourav Biswas 101 Nov 10, 2022
High frequency AI based algorithmic trading module.

Flow Flow is a high frequency algorithmic trading module that uses machine learning to self regulate and self optimize for maximum return. The current

null 59 Dec 14, 2022
A resource for learning about deep learning techniques from regression to LSTM and Reinforcement Learning using financial data and the fitness functions of algorithmic trading

A tour through tensorflow with financial data I present several models ranging in complexity from simple regression to LSTM and policy networks. The s

null 195 Dec 7, 2022
Algorithmic trading with deep learning experiments

Deep-Trading Algorithmic trading with deep learning experiments. Now released part one - simple time series forecasting. I plan to implement more soph

Alex Honchar 1.4k Jan 2, 2023
Algorithmic Trading using RNN

Deep-Trading This an implementation adapted from Rachnog Neural networks for algorithmic trading. Part One — Simple time series forecasting and this c

Hazem Nomer 29 Sep 4, 2022
This project is a loose implementation of paper "Algorithmic Financial Trading with Deep Convolutional Neural Networks: Time Series to Image Conversion Approach"

Stock Market Buy/Sell/Hold prediction Using convolutional Neural Network This repo is an attempt to implement the research paper titled "Algorithmic F

Asutosh Nayak 136 Dec 28, 2022
LiuAlgoTrader is a scalable, multi-process ML-ready framework for effective algorithmic trading

LiuAlgoTrader is a scalable, multi-process ML-ready framework for effective algorithmic trading. The framework simplify development, testing, deployment, analysis and training algo trading strategies. The framework automatically analyzes trading sessions, and the analysis may be used to train predictive models.

Amichay Oren 458 Dec 24, 2022