Trade Calendar

Trading calendar for the Shanghai (SSE) and Shenzhen (SZSE) exchanges, flagging whether each calendar date is a trading day and providing the preceding trading day (pretrade_date). It supports backtest date alignment, rolling-window construction, gap-filling for missing sessions, and holiday detection. Results are returned per exchange; the two calendars almost always agree but should be queried by the relevant exchange. The calendar is updated as official holiday schedules are published, so confirm coverage of the target year before cross-year backtests.

GET /v2/reference/trade-calendar

Parameters

Name Type Required Description
exchange string No Exchange: SSE / SZSE (default SSE)
is_open int No Is trading day: 1 open / 0 closed
start_date string No Start date (YYYYMMDD)
end_date string No End date (YYYYMMDD)

Response Fields

Field Type Description
exchange string Exchange code (SSE / SZSE)
cal_date string Calendar date
is_open int 1=trading day, 0=closed
pretrade_date string Previous trading date

API Example

cURL
curl -H "X-API-Key: YOUR_KEY" \
  "https://asharehub.com/v2/reference/trade-calendar?exchange=SSE"
Python SDK
from asharehub import AShareHub

client = AShareHub(api_key="YOUR_KEY")
df = client.trade_calendar(exchange="SSE")
print(df.head())

Sample Data

returns a pandas.DataFrame
exchangecal_dateis_openpretrade_date
SSE20261231120261230
SSE20261230120261229
SSE20261229120261228