zipline

Zipline import error. No module named zipline.transforms

六眼飞鱼酱① 提交于 2019-12-04 15:47:41
I am not able to import the zipline.transforms module >>> from zipline.transforms import batch_transform Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'zipline.transforms' Disclaimer: I'm currently a maintainer of Zipline. I'm guessing the reason you're seeing this error is because that particular module was removed a while back (assuming you're using zipline 1.0.0 or later). If you want to do things similar to transforms you'll need to call data.history() to get your pricing data, and call numpy/pandas functions like .avg() or .std() , or

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

允我心安 提交于 2019-12-03 17:18:36
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 to get trace messages from zipline.utils.cli import maybe_show_progress def viacsv(symbols,start=None,end=None): # strict this in memory so that we can reiterate over it. # (Because it could be a generator and they live only once) tuSymbols = tuple(symbols) if boDebug: print "entering viacsv. tuSymbols=",tuSymbols # Define our custom ingest function

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

穿精又带淫゛_ 提交于 2019-12-03 12:49:59
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 minor 2008-01-03 00:00:00+00:00 SPY 129.93 KO 26.38 PEP 64.78 2008-01-04 00:00:00+00:00 SPY 126.74 KO 26.43 PEP 64.59 2008-01-07 00:00:00+00:00 SPY 126.63 KO 27.05 PEP 66.10 2008-01-08 00:00:00+00:00 SPY 124.59 KO 27.16 PEP 66.63 I need to convert this frame to look like this: SPY KO PEP 2008-01-03 00:00:00+00:00 129.93 26.38 64.78 2008-01-04 00:00:00+00:00 126.74 26.43 64.59 2008-01-07

zipline backtesting using non-US (European) intraday data

被刻印的时光 ゝ 提交于 2019-12-03 05:22:01
问题 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 894.55 112.105 1777.25 2014-07-01 08:32:00 321.150 894.70 112.095 1777.00 2014-07-01 08:34:00 321.075 894.80 112.140 1776.50 2014-07-01 08:36:00 321.725 894.80 112.255 1777.00 2014-07-01 08:38:00 321.675 894.70 112.290 1777.00 I've followed moving-averages tutorial here, replacing "AAPL" with my own symbol code, and the historical calls

zipline backtesting using non-US (European) intraday data

ε祈祈猫儿з 提交于 2019-12-02 18:37:52
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 894.55 112.105 1777.25 2014-07-01 08:32:00 321.150 894.70 112.095 1777.00 2014-07-01 08:34:00 321.075 894.80 112.140 1776.50 2014-07-01 08:36:00 321.725 894.80 112.255 1777.00 2014-07-01 08:38:00 321.675 894.70 112.290 1777.00 I've followed moving-averages tutorial here , replacing "AAPL" with my own symbol code, and the historical calls with "1m" data instead of "1d". Then I do the final call using algo_obj.run(DataFrameSource(mydf)) ,

pip install gives error: Unable to find vcvarsall.bat

妖精的绣舞 提交于 2019-11-26 18:27:48
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, requests, python-dateutil, six Running setup.py install for blist building '_blist' extension error: Unable to find vcvarsall.bat Complete output from command C:\Python27\python.exe -c "import setuptools;__ file__='c:\\users\\ThatsMe\\appdata\\local\\temp\\pip-build-ThatsMe\\blist\\setup.py';ex ec(compile(open(__file__).read().replace('\r\n', '\n'), __file__,