KeyError: Equity(71, symbol=u'USDT_BTC', asset_name='', exchange=u'POLO', start_date=Timestamp('2015-02-19 00:00:00+0000', tz='UTC'), end_date=Timestamp('2017-08-09 00:00:00+0000', tz='UTC'), first_traded=None, auto_close_date=None, exchange_full=u'POLO')
Here is how you can reproduce this issue on your machine:
C:\Anaconda3\envs\python27\lib\site-packages\ipykernel_launcher.py:50: ZiplineDeprecationWarning: `data[sid(N)]` is deprecated. Use `data.current`.
i: 1
KeyErrorTraceback (most recent call last)
<ipython-input-4-c2ead63b7fce> in <module>()
76 end=end,
77 capital_base=100000,
---> 78 bundle='poloniex'
79 )
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\utils\run_algo.pyc in run_algorithm(start, end, initialize, capital_base, handle_data, before_trading_start, analyze, data_frequency, data, bundle, bundle_timestamp, default_extension, extensions, strict_extensions, environ)
412 print_algo=False,
413 local_namespace=False,
--> 414 environ=environ,
415 )
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\utils\run_algo.pyc in _run(handle_data, initialize, before_trading_start, analyze, algofile, algotext, defines, data_frequency, capital_base, data, bundle, bundle_timestamp, start, end, output, print_algo, local_namespace, environ)
231 ).run(
232 data,
--> 233 overwrite_sim_params=False,
234 )
235
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\algorithm.pyc in run(self, data, overwrite_sim_params)
740 try:
741 perfs = []
--> 742 for perf in self.get_generator():
743 perfs.append(perf)
744
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\gens\tradesimulation.pyc in transform(self)
221 for dt, action in self.clock:
222 if action == BAR:
--> 223 for capital_change_packet in every_bar(dt):
224 yield capital_change_packet
225 elif action == SESSION_START:
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\gens\tradesimulation.pyc in every_bar(dt_to_use, current_data, handle_data)
134 perf_tracker.process_commission(commission)
135
--> 136 handle_data(algo, current_data, dt_to_use)
137
138 # grab any new orders from the blotter, then clear the list.
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\utils\events.pyc in handle_data(self, context, data, dt)
214 context,
215 data,
--> 216 dt,
217 )
218
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\utils\events.pyc in handle_data(self, context, data, dt)
233 """
234 if self.rule.should_trigger(dt):
--> 235 self.callback(context, data)
236
237
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\algorithm.pyc in handle_data(self, data)
475 def handle_data(self, data):
476 if self._handle_data:
--> 477 self._handle_data(self, data)
478
479 # Unlike trading controls which remain constant unless placing an
<ipython-input-4-c2ead63b7fce> in handle_data(context, data)
48
49 # Retrieve current asset price from pricing data
---> 50 price = data[context.asset].price
51
52 # Check if still buying and could (approximately) afford another purchase
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\_protocol.pyx in catalyst._protocol.SidView.__getattr__ (catalyst\_protocol.c:12347)()
869 return self.sid
870
--> 871 return self.data_portal.get_spot_value(
872 self.asset,
873 column,
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\data_portal.pyc in get_spot_value(self, assets, field, dt, data_frequency)
551
552 if assets_is_scalar:
--> 553 return get_single_asset_value(assets)
554 else:
555 return list(map(get_single_asset_value, assets))
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\data_portal.pyc in get_single_asset_value(asset)
534 else:
535 return self._get_daily_spot_value(
--> 536 asset, field, session_label,
537 )
538 else:
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\data_portal.pyc in _get_daily_spot_value(self, asset, column, dt)
760 try:
761 value = reader.get_value(
--> 762 asset, found_dt, "close"
763 )
764 if not isnull(value):
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\dispatch_bar_reader.pyc in get_value(self, sid, dt, field)
95 asset = self._asset_finder.retrieve_asset(sid)
96 r = self._readers[type(asset)]
---> 97 return r.get_value(asset, dt, field)
98
99 def get_last_traded_dt(self, asset, dt):
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\us_equity_pricing.py in get_value(self, sid, dt, field)
731 0.
732 """
--> 733 ix = self.sid_day_index(sid, dt)
734 price = self._spot_col(field)[ix]
735 if field != 'volume':
C:\Anaconda3\envs\python27\lib\site-packages\catalyst\data\us_equity_pricing.py in sid_day_index(self, sid, day)
700 raise NoDataOnDate("day={0} is outside of calendar={1}".format(
701 day, self.sessions))
--> 702 offset = day_loc - self._calendar_offsets[sid]
703 if offset < 0:
704 raise NoDataBeforeDate(
KeyError: Equity(71, symbol=u'USDT_BTC', asset_name='', exchange=u'POLO', start_date=Timestamp('2015-02-19 00:00:00+0000', tz='UTC'), end_date=Timestamp('2017-08-09 00:00:00+0000', tz='UTC'), first_traded=None, auto_close_date=None, exchange_full=u'POLO')