Remap non-std IB exchange values
Add exchange name translation in `.ib.venues.has_holiday()` to handle non-standard exchange codes when looking up holiday gaps.. Deats, - add an ad-hoc lookup dict to remap an IB `Contract.primaryExchange` val which doesn't exist in the `exchange_calendars`'s alias set. - use `.get()` with fallback to map `exch` to new `std_exch` and pass that to `xcals.get_calendar()`. - add the case i just caught, `'ARCA'` -> `'ARCX'` to the table when i loaded the `gld.arca.ib` market.. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-codeib_async
parent
9247746a79
commit
ee09f519a9
|
|
@ -83,7 +83,14 @@ def has_holiday(
|
||||||
'''
|
'''
|
||||||
tz: str = con_deats.timeZoneId
|
tz: str = con_deats.timeZoneId
|
||||||
exch: str = con_deats.contract.primaryExchange
|
exch: str = con_deats.contract.primaryExchange
|
||||||
cal: ExchangeCalendar = xcals.get_calendar(exch)
|
|
||||||
|
# XXX, ad-hoc handle any IB exchange which are non-std
|
||||||
|
# via lookup table..
|
||||||
|
std_exch: dict = {
|
||||||
|
'ARCA': 'ARCX',
|
||||||
|
}.get(exch, exch)
|
||||||
|
|
||||||
|
cal: ExchangeCalendar = xcals.get_calendar(std_exch)
|
||||||
end: datetime = period.end
|
end: datetime = period.end
|
||||||
# _start: datetime = period.start
|
# _start: datetime = period.start
|
||||||
# ?TODO, can rm ya?
|
# ?TODO, can rm ya?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue