rsheftel / pandas_market_calendars

Exchange calendars to use with pandas for trading applications
MIT License
803 stars 173 forks source link

Aliases not picking up holidays #347

Closed npezolano closed 5 months ago

npezolano commented 5 months ago

My understanding is these two aliases HKEX/XHKG should be the same https://github.com/gerrymanoim/exchange_calendars/blob/588ae13d38b96999243f3aa79ef2278f20a626b0/exchange_calendars/calendar_utils.py#L148

Not sure what's causing this using the latest code on the dev branch I'm seeing the following:

cal = mcal.get_calendar('HKEX')
cal.schedule('2023-09-01', '2023-09-09')

image

cal = mcal.get_calendar('XHKG')
cal.schedule('2023-09-01', '2023-09-09')

image

npezolano commented 5 months ago

It looks like the adhoc_holidays property is only being called for HXEX

rsheftel commented 5 months ago

This packages offers two sources for exchange calendars. Native to this package calendars are coded in this repo and listed here: https://pandas-market-calendars.readthedocs.io/en/latest/calendars.html#equity-market-calendars

HKEX is a native calendar and using that alias will use the code in this repo for the calendar.

The other source of calendars is https://github.com/gerrymanoim/exchange_calendars, as documented here: https://pandas-market-calendars.readthedocs.io/en/latest/calendars.html#exchange-calendars-package

XHKG is from that package.

When possible I recommend using the native calendars.