Hello!
Attempted to create a csv file for minute data per Eddie's suggestion:
Hi, Andy:
We have been putting some effort to making the Quantopian script syntax work in Zipline. (The first step was just added to master today https://github.com/quantopian/zipline/commit/b69590a2f709c70dd14d817d1a6bee0b1bb0e7b0).
For minute data, unfortunately a good public source of minute data is something that is currently missing from the ecosystem.
Yahoo! et al. only provide daily data.
If you have access to minute data, you should be able to use the data if you:
- Create a DataFrame source using your data set
- set the data_frequency of your Zipline algorithm to 'minute'
Hope that helps!
- Eddie
Following Eddie's suggestion:
1) created a minute intraday file named "AAPL-2014-01-09 14-30-00+00-00-2014-01-10 21-00-00+00-00.csv"
2) located in ".....zipline\cache\"
3) containing as follows:
Date,Open,High,Low,Close,Volume,Adj Close
2014-01-08 00:00:00+0000,546.8,546.86,535.35,536.53,1000000,536.52
2014-01-09 14:30:00+0000,546.8,546.86,535.35,536.53,1000100,536.52
2014-01-09 14:31:00+0000,546.8,546.86,535.35,536.53,1000200,536.52
2014-01-09 14:32:00+0000,546.8,546.86,535.35,536.53,1000300,536.52
2014-01-09 14:33:00+0000,546.8,546.86,535.35,536.53,1000400,536.52
..... 2014-01-09 20:55:00+0000,546.8,546.86,535.35,536.53,1038600,536.52
2014-01-09 20:56:00+0000,546.8,546.86,535.35,536.53,1038700,536.52
2014-01-09 20:57:00+0000,546.8,546.86,535.35,536.53,1038800,536.52
2014-01-09 20:58:00+0000,546.8,546.86,535.35,536.53,1038900,536.52
2014-01-09 20:59:00+0000,546.8,546.86,535.35,536.53,1039000,536.52
2014-01-09 21:00:00+0000,546.8,546.86,535.35,536.53,1039000,536.52
2014-01-10 00:00:00+0000,539.83,540.8,531.11,532.95,1000000,532.94
2014-01-10 14:30:00+0000,539.83,540.8,531.11,532.95,1000100,532.94
2014-01-10 14:31:00+0000,539.83,540.8,531.11,532.95,1000200,532.94
2014-01-10 14:32:00+0000,539.83,540.8,531.11,532.95,1000300,532.94
2014-01-10 14:33:00+0000,539.83,540.8,531.11,532.95,1000400,532.94
2014-01-10 14:34:00+0000,539.83,540.8,531.11,532.95,1000500,532.94
2014-01-10 14:35:00+0000,539.83,540.8,531.11,532.95,1000600,532.94
.... 2014-01-10 20:55:00+0000,539.83,540.8,531.11,532.95,1038600,532.94
2014-01-10 20:56:00+0000,539.83,540.8,531.11,532.95,1038700,532.94
2014-01-10 20:57:00+0000,539.83,540.8,531.11,532.95,1038800,532.94
2014-01-10 20:58:00+0000,539.83,540.8,531.11,532.95,1038900,532.94
2014-01-10 20:59:00+0000,539.83,540.8,531.11,532.95,1039000,532.94
2014-01-10 21:00:00+0000,539.83,540.8,531.11,532.95,1039100,532.94
4) Received Error as follows (line #'s a little different due to included print statements):
Traceback (most recent call last):
File "C:\afc_working\0_zipline\zipline-master\zipline\examples\buyapple_minute.py", line 57, in
results = simple_algo.run(data)
File "C:\Python27\lib\site-packages\zipline-0.6.0-py2.7.egg\zipline\algorithm.py", line 333, in run
for perf in self.gen:
File "C:\Python27\lib\site-packages\zipline-0.6.0-py2.7.egg\zipline\gens\tradesimulation.py", line 156, in transform
self.process_event(event)
File "C:\Python27\lib\site-packages\zipline-0.6.0-py2.7.egg\zipline\gens\tradesimulation.py", line 96, in process_event
self.algo.perf_tracker.process_event(event)
File "C:\Python27\lib\site-packages\zipline-0.6.0-py2.7.egg\zipline\finance\performance\tracker.py", line 279, in process_event
self.all_benchmark_returns[midnight] = event.returns
File "C:\Python27\lib\site-packages\pandas\core\series.py", line 845, in setitem
raise KeyError('%s not in this series!' % str(key))
KeyError: '2014-01-09 00:00:00+00:00 not in this series!'
I have been researching this all the down into Pandas.tseries.index.DatetimeIndex, and still no additional insight.
Please HELP! :)
Thanks,
Andy