tkp-archive / pyex-zipline Goto Github PK
View Code? Open in Web Editor NEWpyEX + Zipline
License: Apache License 2.0
pyEX + Zipline
License: Apache License 2.0
The library works fine with day level trading but it doesn't work with minute level trading. I tried modifying the time granularity from '5y' to '1d' and here is the error when executing your ipynb:
KeyError Traceback (most recent call last)
in ()
1 start = datetime(2014, 12, 1, 0, 0, 0, 0, pytz.utc)
2 end = datetime(2017, 6, 1, 0, 0, 0, 0, pytz.utc)
----> 3 data = load_from_iex(['aapl'], start, end)
~/workspace/pyEX-zipline/pyEXzipline/ingest.py in load_from_iex(symbols, start, end)
18 data = {}
19 for symbol in symbols:
---> 20 data[symbol] = _get_data(symbol, start, end)
21
22 panel = pd.Panel(data)
~/workspace/pyEX-zipline/pyEXzipline/ingest.py in _get_data(symbol, start, end)
5 def _get_data(symbol, start, end):
6 df = chartDF(symbol, '1d')
----> 7 df = df[['open', 'close', 'high', 'low', 'volume']].set_index(df['date'])
8 df.index = pd.to_datetime(df.index)
9 if start:
/usr/local/lib/python3.6/site-packages/pandas/core/frame.py in getitem(self, key)
1989 if isinstance(key, (Series, np.ndarray, Index, list)):
1990 # either boolean or fancy integer index
-> 1991 return self._getitem_array(key)
1992 elif isinstance(key, DataFrame):
1993 return self._getitem_frame(key)
/usr/local/lib/python3.6/site-packages/pandas/core/frame.py in _getitem_array(self, key)
2033 return self.take(indexer, axis=0, convert=False)
2034 else:
-> 2035 indexer = self.ix._convert_to_indexer(key, axis=1)
2036 return self.take(indexer, axis=1, convert=True)
2037
/usr/local/lib/python3.6/site-packages/pandas/core/indexing.py in _convert_to_indexer(self, obj, axis, is_setter)
1212 mask = check == -1
1213 if mask.any():
-> 1214 raise KeyError('%s not in index' % objarr[mask])
1215
1216 return _values_from_object(indexer)
KeyError: "['open' 'close'] not in index"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.