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
2
votes
1 answer

Zipline Error: AttributeError: 'NoneType' object has no attribute 'fetch_csv'

I just installed Zipline on Windows 10, Python 2.7 system using conda. When I tried to use a function fetch_csv from zipline.api, I get an error AttributeError: 'NoneType' object has no attribute 'fetch_csv' Why can't I load the function…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
2
votes
3 answers

What does the @ symbol do in iPython/Python

A code that I'm reading uses @batch_transform. What does the @ symbol do? Is it ipython specific? from zipline.transforms import batch_transform from scipy import stats @batch_transform def regression_transform(data): pep_price =…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
1
vote
0 answers

Installing python packages on Ubuntu virtual machines with same python version and pip version yields different results

I am attempting to replicate an environment from an old VM from 2019 that runs the following: Old Environment: Ubuntu 18.10 (GNU/Linux 4.18.0-1015-gcp x86_64) pip 21.1.3 Python 3.6.8 The above environment is no longer available in GCP due to the…
1
vote
1 answer

PyAlgoTrade custom CSV date error Invalid datetime. It must be bigger than that last one

I am trying to add custom csv data into PyAlgoTrade using the addValuesFromCSV method, and I am getting this error: 2021-10-14 17:50:00 {'Open': 4886.0, 'High': 4888.0, 'Low': 4879.0, 'Close': 4883.0} 2021-10-14 17:55:00 {'Open': 4883.0, 'High':…
1
vote
0 answers

Python zipline orders never fulfilled for fake symbols

Relative zipline newbie here (FYI I have been learning mainly via the book TRADING EVOLVED plus trial and error). I have a few data bundles that extract from my mysql db of historical daily price data and work fine - as in I can run algos on it…
1
vote
1 answer

Directly passing pandas data into zipline

I am currently looking for a way to directly pass in a pandas dataframe or csv file to zipline for simple backtesting WITHOUT having to ingest a data bundle. The reason is that I am planning to generate new data outside of the existing bundle during…
Tony Zhang
  • 11
  • 2
1
vote
2 answers

Backtesting a portfolio in Python

I am trying to do a backtest on a Markowitz portfolio. So far I've tried zipline, backtrader and QSTrader (although QSTrader may work, but there is no documentation so its very hard). I haven't had any luck with creating the backtest as I've…
sword134
  • 91
  • 1
  • 11
1
vote
1 answer

Having trouble setting API key for zipline ingestion

I ran the following commands in terminal on a mac running catalina. As far as I can tell my path is correct (I launched cmd from my conda environment) set QUANDL_API_KEY=mykey zipline ingest -b quandl I get the following error: ValueError: Please…
Alex
  • 11
  • 3
1
vote
0 answers

Adding custom column to zipline to use it in handle_data

I am facing some problem , i am using zipline to backtest data. with the normal OHLC format everything works fine but I would like to be able to use other columns that are in my csv file apart from the one (open,close, high,low, volum) that zipline…
Alexandre29
  • 57
  • 2
  • 8
1
vote
1 answer

Quandl ingestion with zipline lacks data

I have recently installed Zipline and ingested Quandl data. However, it seems that Quandl hasn't ingested data of the years 2018,2019 and 2020. Just by plotting a stock price you can see this. AAPL stock 2016-2020: Why would this happen? Quandl…
1
vote
0 answers

Unable to install zipline and TA-lib python libs

I tried installing both of them but I am getting the error, I tried every other error post like this but this is not getting fixed. pip install zipline Collecting ziplineNote: you may need to restart the kernel to use updated packages. Using cached…
1
vote
1 answer

CSV not being loaded into pandas for zipline project

I am trying to use zipline for backtesting and I am getting this error: JSONDecodeError: Expecting value: line 1 column 1 (char 0) It seems to mean that the contents of the CSV are not being loaded into the dataframe. I am doing it from a Jupyter…
reallymemorable
  • 882
  • 1
  • 11
  • 28
1
vote
0 answers

I want to use zipline and backtest but data i am retrieving in saying not defined

from zipline import run_algorithm from zipline.api import order_target_percent,symbol from datetime import datetime import pytz import matplotlib.pyplot as plt def initalize(context): context.stock=symbol('AAPL') …
1
vote
1 answer

Zipline + Quandl JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I'm getting this error when I'm running the following code: from zipline import run_algorithm from zipline.api import symbol, order_target_percent import pyfolio as pf import pytz import pandas as pd from datetime import datetime def…
Fede
  • 1,656
  • 4
  • 24
  • 42
1
vote
1 answer

Is there a way to create a pipeline locally using zipline?

I have set up zipline locally on PyCharm. The simulations work, moreover, I have access to premium data from quandl (which automatically updated when I entered my API key). However, now my question is, how do I make a pipeline locally using zipline.…
cem
  • 15
  • 7
1 2
3
9 10