Python pyalgotrade Quandl feed Error

313 views Asked by At

having an error with feed.addBarsFromCSV when combined with quandlefeed as below and used on instrument "CBOE/VIX"

import quandl as qd
from pyalgotrade.tools import quandl
from pyalgotrade.barfeed import quandlfeed

name = '%s.csv'
sym = "VIX"

data = qd.get("CBOE/VIX", start_date="2016-1-1", end_date="2016-1-10")
data.rename(columns={'VIX Open': 'Open'}, inplace=True)
data.rename(columns={'VIX High': 'High'}, inplace=True)
data.rename(columns={'VIX Low': 'Low'}, inplace=True)
data.rename(columns={'VIX Close': 'Close'}, inplace=True)
data.to_csv(name % (sym))
feed = quandlfeed.Feed()
feed.addBarsFromCSV("CBOE/VIX", name % (sym))

btw, the code works perfectly on "WIKI/AAPL" for example, but seems not to work on some instruments I would like to use like "CBOE/VIX".

The error I get is below: Traceback (most recent call last):

File "", line 2, in feed.addBarsFromCSV("CBOE/VIX", name % (sym))

File "C:\Program Files\Anaconda2\lib\site-packages\PyAlgoTrade-0.17-py2.7.egg\pyalgotrade\barfeed\csvfeed.py", line 252, in addBarsFromCSV BarFeed.addBarsFromCSV(self, instrument, path, rowParser)

File "C:\Program Files\Anaconda2\lib\site-packages\PyAlgoTrade-0.17-py2.7.egg\pyalgotrade\barfeed\csvfeed.py", line 120, in addBarsFromCSV bar_ = rowParser.parseBar(row)

File "C:\Program Files\Anaconda2\lib\site-packages\PyAlgoTrade-0.17-py2.7.egg\pyalgotrade\barfeed\csvfeed.py", line 169, in parseBar volume = float(csvRowDict[self.__volumeColName])

KeyError: 'Volume'

0

There are 0 answers