TradingCalendar vs ExchangeCalendar when trying to load custom bundle

Hi Stefan,

I’m trying to load my custom bundle with new calendar however I have a problem with trading_calendar and exchange_calendar.

First, I’m not sure about the differences between the two, I only guess one is newer (ExchangeCalendar) than the other (TradingCalendar).

The main issue is when I tried to ingest my custom bundle, ExchangeCalendar is used. If I only create new TradingCalendar, I’ll receive the error:

exchange_calendars.errors.InvalidCalendarName: The requested ExchangeCalendar, , does not exist.

So I have to create a new ExchangeCalendar.

However, when I try run_algorithm, this error is raised:

AssertionError: All readers must share target trading_calendar. Reader=< object at 0x7ff1f0eca5e0> for type=<class ‘zipline.assets._assets.Equity’> uses calendar=<exchange_calendars.exchange_calendar_xhos.XHOSExchangeCalendar object at 0x7ff1f0962fd0> which does not match the desired shared calendar=<trading_calendars.exchange_calendar_xhos.XHOSExchangeCalendar object at 0x7ff1e9f2c670>

I understand that run_algorithm requires TradingCalendar, however I can only ingest ExchangeCalendar as said above.

Could you please look at this issue, did I make a mistake somewhere?