gather_hk_daily_price API¶
Shadow Ingest / API Reference / Hong Kong
gather_hk_daily_price(
stock_codes: list[str],
start_date: str,
end_date: str,
fields: list[str] | None = None,
adjust_type: Literal['raw', 'pre', 'post', 'adj_fwd', 'adj_bwd'] = 'raw',
) -> polars.DataFrame
Returns Hong Kong daily price rows for each trade_date x stock_code.
Parameters¶
| Parameter | Required | Default | Allowed values / shape | Meaning |
|---|---|---|---|---|
stock_codes |
yes | — | list of HK stock codes, e.g. ['00700.XHKG'] |
Which HK stocks to query |
start_date |
yes | — | YYYY-MM-DD |
Inclusive start date |
end_date |
yes | — | YYYY-MM-DD |
Inclusive end date |
fields |
no | None |
list of column names such as ['open', 'close', 'volume'] |
Which price columns to return |
adjust_type |
no | 'raw' |
'raw', 'pre', 'post', 'adj_fwd', 'adj_bwd' |
Which price adjustment to use |
Discovery Workflow¶
import shadow_ingest as si
hk_dates = si.list_hk_market_calendar(year=2026)
hk_codes = si.list_hk_universe(date=hk_dates[-1])
hk_fields = si.list_fields(si.gather_hk_daily_price)
print([d.isoformat() for d in hk_dates[-3:]])
print(hk_codes[:5])
print(hk_fields)
Parameter Notes¶
stock_codes¶
Use list_hk_universe(...) when you want valid HK identifiers for a trading date:
import shadow_ingest as si
hk_codes = si.list_hk_universe(date="2026-06-25")
print(hk_codes[:10])
start_date and end_date¶
Use list_hk_market_calendar(...) when you want valid HK trading dates:
import shadow_ingest as si
hk_dates = si.list_hk_market_calendar(year=2026)
print(hk_dates[-5:])
fields¶
To get the documented supported public values, use:
import shadow_ingest as si
print(si.list_fields(si.gather_hk_daily_price))
The documented field set matches gather_daily_price(...):
| Field | Meaning |
|---|---|
open |
Opening price for the trading day |
high |
Highest traded price during the trading day |
low |
Lowest traded price during the trading day |
close |
Closing price for the trading day |
volume |
Traded share volume for the trading day |
total_turnover |
Total traded value for the trading day |
prev_close |
Previous trading day's close |
limit_up |
Daily upper price limit when available |
limit_down |
Daily lower price limit when available |
num_trades |
Number of trades during the day when available |
adjust_type¶
raw: raw unadjusted pricespre/adj_fwd: forward-adjusted pricespost/adj_bwd: backward-adjusted prices
Copy-Paste Example¶
import shadow_ingest as si
hk_price_df = si.gather_hk_daily_price(
stock_codes=["00700.XHKG"],
start_date="2026-06-25",
end_date="2026-06-25",
fields=["open", "close"],
adjust_type="raw",
)
print(hk_price_df)
print(hk_price_df.schema)
Example Output¶
shape: (1, 4)
┌────────────┬────────────┬───────┬───────┐
│ trade_date ┆ stock_code ┆ open ┆ close │
│ --- ┆ --- ┆ --- ┆ --- │
│ date ┆ str ┆ f64 ┆ f64 │
╞════════════╪════════════╪═══════╪═══════╡
│ 2026-06-25 ┆ 00700.XHKG ┆ 428.6 ┆ 421.4 │
└────────────┴────────────┴───────┴───────┘
Pandas¶
hk_price_pdf = hk_price_df.to_pandas()