Giter Club home page Giter Club logo

pyex-zipline's People

Contributors

benvan avatar timkpaine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyex-zipline's Issues

Minute data

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.