Questions tagged [zipline]

Zipline is a financial backtester for trading algorithms written in Python.

Zipline is a financial backtester for trading algorithms written in Python.The system is fundamentally event-driven and a close approximation of how live-trading systems operate.

http://zipline.io

149 questions
50
votes
10 answers

pip install gives error: Unable to find vcvarsall.bat

Using pip install zipline on Windows 8 with Python 2.7 gives me the error: Downloading/unpacking six (from python-dateutil==2.1->delorean->zipline[all]) Running setup.py egg_info for package six Installing collected packages: blist, pytz,…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
17
votes
1 answer

How to update the deprecated python zipline.transforms module?

I wrote a python program using the quantopian zipline package http://www.zipline.io/beginner-tutorial.html. I recently updated the package and have encountered that the zipline.transforms package is deprecated. I was using two functions from the…
Alex F
  • 2,086
  • 4
  • 29
  • 67
11
votes
6 answers

Get last date in each month of a time series pandas

Currently I'm generating a DateTimeIndex using a certain function, zipline.utils.tradingcalendar.get_trading_days. The time series is roughly daily but with some gaps. My goal is to get the last date in the DateTimeIndex for each…
ikemblem
  • 333
  • 1
  • 2
  • 15
10
votes
1 answer

ENIGMA CATALYST - WARNING: Loader: Refusing to download new treasury data because a download succeeded

I'm playing around with Enigma Catalyst. Unfortunately, the documentation is rather limited. So I'm trying to run their example "hello world" type algo which looks as follows: from catalyst import run_algorithm from catalyst.api import order,…
Timothy Coetzee
  • 5,626
  • 9
  • 34
  • 97
9
votes
1 answer

Zipline: using pandas-datareader to feed in Google Finance dataframe for non-US based financial markets

PLEASE NOTE: This question was successfully answered ptrj below. I have also written a blog post on my blog about my experiences with zipline which you can find here: https://financialzipline.wordpress.com I'm based in South Africa and I'm trying…
Simon
  • 19,658
  • 27
  • 149
  • 217
9
votes
1 answer

Converting a pandas MultiIndex DataFrame from rows-wise to column-wise

I'm working in zipline and pandas and have converted a pandas.Panel to a pandas.DataFrame using the to_frame() method. This is the resulting pandas.DataFrame which as you can see is multi-indexed: price major …
Jason Strimpel
  • 14,670
  • 21
  • 76
  • 106
6
votes
2 answers

zipline backtesting using non-US (European) intraday data

I'm trying to get zipline working with non-US, intraday data, that I've loaded into a pandas DataFrame: BARC HSBA LLOY STAN Date 2014-07-01 08:30:00 321.250 …
Luciano
  • 2,388
  • 1
  • 22
  • 33
6
votes
1 answer

Transforming financial data from postgres to pandas dataframe for use with Zipline

I'm new to Pandas and Zipline, and I'm trying to learn how to use them (and use them with this data that I have). Any sorts of tips, even if no full solution, would be much appreciated. I have tried a number of things, and have gotten quite close,…
Isaac
  • 15,783
  • 9
  • 53
  • 76
5
votes
1 answer

How to solve AssertionError when running backtest on zipline

I'm working through the book Trading Evolved by Andreas Clenow and am running into an AssertionError when trying to run the code for the first backtest on zipilne. I am new to python and zipline and appreciate any guidance on how to solve this…
econlearner
  • 351
  • 2
  • 3
  • 10
5
votes
1 answer

How to use a custom calendar in a custom zipline bundle?

I have the following code in my viacsv.py file that aims to allow a custom bundle to be ingested: # # Ingest stock csv files to create a zipline data bundle import os import numpy as np import pandas as pd import datetime boDebug=True # Set True…
sometimesiwritecode
  • 2,993
  • 7
  • 31
  • 69
4
votes
2 answers

How to manually provide a benchmark in zipline

I want to create a reproducible example where the traded series and the benchmark are manually provided. This would make the life of people that are approaching to zipline incredibly easier. In fact, given the recent shut down of Yahoo!Finance API,…
MLguy
  • 1,776
  • 3
  • 15
  • 28
4
votes
0 answers

Bug of adfuller test with zipline

I've tested ADF with stattools, my code is import statsmodels.tsa.stattools as ts from datetime import datetime import zipline from zipline import TradingAlgorithm from zipline.api import order_target, record, symbol, history,…
Lucas
  • 51
  • 7
4
votes
1 answer

Python: KeyError 'shift'

I am new to Python and try to modify a pair trading script that I found here: https://github.com/quantopian/zipline/blob/master/zipline/examples/pairtrade.py The original script is designed to use only prices. I would like to use returns to fit…
VincentH
  • 1,009
  • 4
  • 13
  • 24
3
votes
3 answers

VS Code not detecting package in conda environment

I used conda install -c Quantopian zipline to install the zipline package in a new conda environment. I activated the conda environment from within VS Code and my settings.json reads as follows: { "python.pythonPath":…
Souvik Chanda
  • 31
  • 1
  • 3
3
votes
1 answer

Zipline: pickle backtest to resume simulation

I have been using Zipline for some time now and could highly benefit from being able to pickle a backtest in order to be able to resume it later. The idea is to save the state of the trading algorithm and update it when new data become available. I…
VincentH
  • 1,009
  • 4
  • 13
  • 24
1
2 3
9 10