Hi Quantopian Community,
I have a question regarding Zipline that I've been stuck on for some weeks. I am using a custom csvdir bundle with about 3,000 stocks. When executing trades in my algorithm, I get the error CannotOrderDelistedAsset: Cannot order CBD, as it started trading on 2017-11-17 00:00:00+00:00. However, in my bundle I have data for this stock back to 1999-01-01. The error points to the algorithm.py file, however I think this is a deeper issue within Zipline.
algorithm.py in _calculate_order_value_amount(self, asset, value)
raise CannotOrderDelistedAsset(
msg="Cannot order {0}, as it started trading on"
" {1}.".format(asset.symbol, asset.start_date)
)
elif normalized_date > asset.end_date:
I also have checked with the charting service I use, and can verify this stock did not start trading on 2017-11-17 but long before that date. Is anyone aware of what is causing Zipline to throw that error?
I thought perhaps if another stock owned that ticker at one point Zipline could be confusing the two companies, but I have verified that's not the case. Also, that wouldn't make much sense to me because theoretically Zipline should be looking in my bundle for the corresponding data.
Second, Zipline will also throw the symbol not found error saying it cannot find tickers in my csv bundle. I found I get different behavior with this if I play with the set_symbol_lookup_date argument, however would prefer to leave it unset so Zipline looks up symbols as of the current trading data to avoid survivorship bias.
I thought of posting this is on the Zipline GitHub Repo but have always found the Quantopian Community to be helpful.
Thanks,
Robert