I am trying to run a simple zipline tutorial to test a trading algorithm in GOOG, and can't get it to work. This is the problem:
dma = DualMovingAverage()
results = dma.run(data)
Returning the following:
data msgpacks aren't distributed with source.
Fetching data from Yahoo Finance.
data msgpacks aren't distributed with source.
Fetching data from data.treasury.gov
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-daf3c4eec6f3> in <module>()
1 dma = DualMovingAverage()
----> 2 results = dma.run(data)
/home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/zipline/algorithm.pyc in run(self, source, sim_params, benchmark_return_source)
297 trans_descr['class'],
298 *trans_descr['args'],
--> 299 **trans_descr['kwargs']
300 )
301 sf.namestring = namestring
/home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/zipline/transforms/utils.pyc in __init__(self, tnfm_class, *args, **kwargs)
111 # usually resolves to our super call.
112 self.state = super(TransformMeta, tnfm_class).__call__(
--> 113 *args, **kwargs)
114 # Normal object instantiation.
115 else:
TypeError: __init__() got an unexpected keyword argument 'days'
I am 'heavy' in the use of libraries for my dev (pandas, scikit-learn, numpy, seaborn, mcerp, etc. plus my own libraries with many dependencies), so I don't know if that has anything to do with it.
In addition to that, I am running everything in Python 2.7 from Enthought, inside a Ubuntu (Virtual Box) VM.
Any help out there in how to fix this issues?
Cheers
" data msgpacks aren't distributed with source." is just a disclaimer telling you that the data doesn't come with the source code.
that's not the source of your error.
the error seems to be on your declaration of the DualMovingAverage() TradingAlgorithm. maybe you need to use start_time and end_time instead of "days"... I don't use zipline's build in data fetcher, instead I prefer to get the data in pandas myself, and then pass it into zipline on the right format. (stock symbols as columns, timestamps as rows and price data as values)
From the zipline source code fo the run method (the method that actually does the work on the algo) :
http://zipline.readthedocs.org/en/latest/_modules/zipline/algorithm.html
http://zipline.readthedocs.org/en/latest/zipline.html