From 7b561e4fac0d0bc872536ddb2e9f190dc59372c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=BD=A9=E4=BC=9F?= Date: Fri, 17 Jul 2026 15:02:48 +0800 Subject: [PATCH] docs: add history candlestick months limit description --- .../docs/quote/stocks/history-candlestick.md | 43 ++++++++++-- .../docs/quote/stocks/history-candlestick.md | 70 ++++++++++++++++--- .../docs/quote/stocks/history-candlestick.md | 70 ++++++++++++++++--- 3 files changed, 154 insertions(+), 29 deletions(-) diff --git a/docs/en/docs/quote/stocks/history-candlestick.md b/docs/en/docs/quote/stocks/history-candlestick.md index 6d3b8312..c8c3a898 100644 --- a/docs/en/docs/quote/stocks/history-candlestick.md +++ b/docs/en/docs/quote/stocks/history-candlestick.md @@ -44,7 +44,7 @@ longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 | ∟ date | string | No | Query date, in `YYYYMMDD` format, for example: 20231016. Default value: latest trading day of the underlying market. | | ∟ minute | string | No | Query time, in `HHMM` format, for example: 09:35, only valid when querying minute-level data | | ∟ count | int32 | No | Count of cancdlestick, valid range:`[1,1000]`. Default value: `10` | -| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight)

Note: Overnight data is included free in US LV1, US stocks only; enable the `enable_overnight` parameter to receive it. | +| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight)

Note: Overnight data is included free in US LV1, US stocks only; enable the `enable_overnight` parameter to receive it. | ### Protobuf @@ -429,12 +429,41 @@ According to the user’s assets and transactions, the number of targets that di ## Description of historical candlesticks range -| Market | Daily/Weekly/Monthly/Year period candlesticks | Minute candlesticks | Description | -| ------------------ | --------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------- | -| Hong Kong stocks | 2004-6-1 to present | 2022-09-28 to present | | -| U.S. stocks | 2010-6-1 to present | 2023-12-4 to present | | -| U.S. stock options | - | - | U.S. stock options historical data is currently not supported, and data for longer periods will be released later | -| A shares | 1999-11-1 to present | 2022-08-25 to present | | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MarketDaily/Weekly/Monthly/Year period candlesticksMinute candlesticksDescription
Hong Kong stocks2004-06 to present2008-11 to present + The available history length for minute candlesticks varies based on the user's total assets:
+ (1) Total assets < HKD 80,000: Up to 3 years of historical minute candlestick data is available. Calculated by calendar month — for example, if the current month is May 2026, data from May 2023 to present is accessible.
+ (2) Total assets ≥ HKD 80,000: Up to 8 years of historical minute candlestick data is available. Calculated by calendar month — for example, if the current month is May 2026, data from May 2018 to present is accessible. If less than 8 years of data exists, all available records from the earliest date will be returned.
+ For longer historical data coverage, please contact customer support. +
U.S. stocks2010-06 to present2003-09 to present
A shares1999-11 to present2022-08 to present
U.S. stock options--U.S. stock options historical data is currently not supported, and data for longer periods will be released later
## Rate limite diff --git a/docs/zh-CN/docs/quote/stocks/history-candlestick.md b/docs/zh-CN/docs/quote/stocks/history-candlestick.md index 9c080945..bb377782 100644 --- a/docs/zh-CN/docs/quote/stocks/history-candlestick.md +++ b/docs/zh-CN/docs/quote/stocks/history-candlestick.md @@ -44,7 +44,7 @@ longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 | ∟ date | string | 否 | 查询日期,格式为 `YYYYMMDD`,例如:20231016,为空时使用标的所在市场的最新交易日 | | ∟ minute | string | 否 | 查询时间,格式为 `HHMM`,例如:09:35,仅在查询分钟级别 K 线时有效 | | ∟ count | int32 | 否 | 查询数量,填写范围 `[1,1000]`,为空时默认查询 `10` 条 | -| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有延长时段(盘前,盘中,盘后,夜盘)

注意:夜盘数据已包含在 US LV1 中免费提供,仅支持美股;开启 `enable_overnight` 参数即可获取 | +| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有延长时段(盘前,盘中,盘后,夜盘)

注意:夜盘数据已包含在 US LV1 中免费提供,仅支持美股;开启 `enable_overnight` 参数即可获取 | ### Protobuf @@ -131,14 +131,34 @@ if __name__ == "__main__": ```javascript -const { Config, QuoteContext, OAuth, Period, AdjustType, TradeSessions, NaiveDatetime, NaiveDate, Time } = require('longbridge') +const { + Config, + QuoteContext, + OAuth, + Period, + AdjustType, + TradeSessions, + NaiveDatetime, + NaiveDate, + Time, +} = require('longbridge') async function main() { - const oauth = await OAuth.build("your-client-id", (_, url) => { console.log("Open this URL to authorize: " + url) }) + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) const config = Config.fromOAuth(oauth) const ctx = QuoteContext.new(config) const datetime = new NaiveDatetime(new NaiveDate(2023, 1, 1), new Time(0, 0, 0)) - const resp = await ctx.historyCandlesticksByOffset("700.HK", Period.Day, AdjustType.NoAdjust, true, datetime, 10, TradeSessions.Intraday) + const resp = await ctx.historyCandlesticksByOffset( + '700.HK', + Period.Day, + AdjustType.NoAdjust, + true, + datetime, + 10, + TradeSessions.Intraday + ) console.log(resp) } main().catch(console.error) @@ -276,7 +296,6 @@ func main() { - ## Response ### Response Properties @@ -410,12 +429,41 @@ message Candlestick { ## 历史 K 线区间说明 -| 市场 | 日/周/月/年 K 线 | 分钟 K 线 | 说明 | -| -------- | ---------------- | --------------- | ------------------------------------------------------ | -| 港股 | 2004-6-1 至今 | 2022-09-28 至今 | | -| 美股 | 2010-6-1 至今 | 2023-12-4 至今 | | -| 美股期权 | - | - | 美股期权历史数据目前暂不支持,待后续开放更长时段的数据 | -| A 股 | 1999-11-1 至今 | 2022-08-25 至今 | | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
市场日/周/月/年 K 线分钟 K 线说明
港股2004-06 至今2008-11 至今 + 依据用户总资产,可查询的历史分钟 K 线时长如下:
+ (1)用户总资产 < 8 万港币:可查询近 3 年的历史分钟 K 线数据(按自然月计算,如当前为 2026 年 5 月,则可查 2023 年 5 月至今)。
+ (2)用户总资产 ≥ 8 万港币:可查询近 8 年的历史分钟 K 线数据(按自然月计算,如当前为 2026 年 5 月,则可查 2018 年 5 月至今)。若实际数据不足 8 年,则支持查询自最早可用数据起的所有记录。
+ 如需查询更长周期的历史数据,可联系客服咨询。 +
美股2010-06 至今2003-09 至今
A 股1999-11 至今2022-08 至今
美股期权--美股期权历史数据目前暂不支持,待后续开放更长时段的数据
## 频次限制 diff --git a/docs/zh-HK/docs/quote/stocks/history-candlestick.md b/docs/zh-HK/docs/quote/stocks/history-candlestick.md index 36096d8a..f754b457 100644 --- a/docs/zh-HK/docs/quote/stocks/history-candlestick.md +++ b/docs/zh-HK/docs/quote/stocks/history-candlestick.md @@ -44,7 +44,7 @@ longbridge kline history NVDA.US --start 2025-01-01 --end 2025-12-31 | ∟ date | string | 否 | 查詢日期,格式為 `YYYYMMDD`,例如:20231016,為空時使用標的所在市場的最新交易日 | | ∟ minute | string | 否 | 查詢時間,格式為 `HHMM`,例如:09:35,僅在查詢分鍾級別 k 線時有效 | | ∟ count | int32 | 否 | 查詢數量,填寫範圍 `[1,1000]`,為空時默認查詢 `10` 條 | -| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤)

注意:夜盤數據已包含在 US LV1 中免費提供,僅支援美股;開啟 `enable_overnight` 參數即可獲取 | +| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤)

注意:夜盤數據已包含在 US LV1 中免費提供,僅支援美股;開啟 `enable_overnight` 參數即可獲取 | ### Protobuf @@ -131,14 +131,34 @@ if __name__ == "__main__": ```javascript -const { Config, QuoteContext, OAuth, Period, AdjustType, TradeSessions, NaiveDatetime, NaiveDate, Time } = require('longbridge') +const { + Config, + QuoteContext, + OAuth, + Period, + AdjustType, + TradeSessions, + NaiveDatetime, + NaiveDate, + Time, +} = require('longbridge') async function main() { - const oauth = await OAuth.build("your-client-id", (_, url) => { console.log("Open this URL to authorize: " + url) }) + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) const config = Config.fromOAuth(oauth) const ctx = QuoteContext.new(config) const datetime = new NaiveDatetime(new NaiveDate(2023, 1, 1), new Time(0, 0, 0)) - const resp = await ctx.historyCandlesticksByOffset("700.HK", Period.Day, AdjustType.NoAdjust, true, datetime, 10, TradeSessions.Intraday) + const resp = await ctx.historyCandlesticksByOffset( + '700.HK', + Period.Day, + AdjustType.NoAdjust, + true, + datetime, + 10, + TradeSessions.Intraday + ) console.log(resp) } main().catch(console.error) @@ -276,7 +296,6 @@ func main() { - ## Response ### Response Properties @@ -410,12 +429,41 @@ message Candlestick { ## 曆史 K 線區間說明 -| 市場 | 日/周/月/年 K 線 | 分鍾 K 線 | 說明 | -| -------- | ---------------- | --------------- | ------------------------------------------------------ | -| 港股 | 2004-6-1 至今 | 2022-09-28 至今 | | -| 美股 | 2010-6-1 至今 | 2023-12-4 至今 | | -| 美股期權 | - | - | 美股期權曆史數據目前暫不支持,待後續開放更長時段的數據 | -| A 股 | 1999-11-1 至今 | 2022-08-25 至今 | | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
市場日/周/月/年 K 線分鍾 K 線說明
港股2004-06 至今2008-11 至今 + 依據用戶總資產,可查詢的歷史分鐘 K 線時長如下:
+ (1)用戶總資產 < 8 萬港幣:可查詢近 3 年的歷史分鐘 K 線數據(按自然月計算,如當前為 2026 年 5 月,則可查 2023 年 5 月至今)。
+ (2)用戶總資產 ≥ 8 萬港幣:可查詢近 8 年的歷史分鐘 K 線數據(按自然月計算,如當前為 2026 年 5 月,則可查 2018 年 5 月至今)。若實際數據不足 8 年,則支援查詢自最早可用數據起的所有記錄。
+ 如需查詢更長周期的歷史數據,可聯繫客服諮詢。 +
美股2010-06 至今2003-09 至今
A 股1999-11 至今2022-08 至今
美股期權--美股期權曆史數據目前暫不支持,待後續開放更長時段的數據
## 頻次限製