跳转至

list_hk_market_calendar API

Shadow Ingest / API Reference / Hong Kong
list_hk_market_calendar(
    start_date=None,
    end_date=None,
    year: int | None = None,
) -> list[datetime.date]

Returns valid Hong Kong trading dates from the HK daily price partitions.

Use this helper before calling gather_hk_daily_price(...) or gather_hk_daily_snapshot(...).

Parameters

Parameter Required Default Allowed values / shape Meaning
start_date no None YYYY-MM-DD, YYYYMMDD, datetime.date, date-like object Inclusive lower bound
end_date no None YYYY-MM-DD, YYYYMMDD, datetime.date, date-like object Inclusive upper bound
year no None integer year such as 2026 Shortcut for the full calendar year

Parameter Notes

  • year cannot be combined with start_date or end_date
  • the return value is sorted ascending
  • this API is separate from list_market_calendar(...)
  • this API does not accept a market parameter

Copy-Paste Example

import shadow_ingest as si

hk_dates = si.list_hk_market_calendar(year=2026)

print([d.isoformat() for d in hk_dates[-5:]])
print("2026-06-25" in {d.isoformat() for d in hk_dates})

Example Output

[
  '2026-06-18',
  '2026-06-22',
  '2026-06-23',
  '2026-06-24',
  '2026-06-25',
]
True