Historical Candlesticks by Offset
history_candlesticks_by_offsetFetch historical candlesticks relative to a reference time. Configure symbol, period, count, direction, trade sessions; results cap to account limits if count exceeds entitlement.
Instructions
Get historical candlestick data by offset from a reference time. Only symbol is required; period defaults to day (1m/5m/15m/30m/60m/day/week/month/year), count to 100, forward_adjust/forward to false, trade_sessions to all. If the account's entitlement caps out below the requested count, this returns as many candles as allowed instead of erroring — check the returned array length against count if an exact number matters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _jq | No | Optional jq filter (jaq syntax) applied to this tool's JSON response before it is returned; it never changes the upstream request. One output is returned as-is, several as a JSON array, none as []. Module imports and the `env`/`debug`/`stderr` builtins are unavailable. Example: .data | map({symbol}). Omit for the full response. | |
| time | No | Reference datetime (yyyy-mm-ddTHH:MM:SS), omit to start from latest | |
| count | No | Number of candlesticks (optional, max 1000; default 100) | |
| period | No | Period: 1m, 5m, 15m, 30m, 60m, day, week, month, year (default: day) | day |
| symbol | Yes | Security symbol, e.g. "700.HK". Use the canonical form — a padded code like "00700.HK" returns an empty record, not an error. | |
| forward | No | Whether to query forward in time (true) or backward (false; default) | |
| forward_adjust | No | Whether to forward-adjust for splits/dividends (default: false / no adjust) | |
| trade_sessions | No | Trade sessions: "intraday" (regular hours only) or "all" (include pre-market and post-market; default "all") | all |