Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions docs/en/docs/quote/stocks/history-candlestick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)<br/><br/>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)<br/><br/>Note: Overnight data is included free in US LV1, US stocks only; enable the `enable_overnight` parameter to receive it. |

### Protobuf

Expand Down Expand Up @@ -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 | |
<table>
<tr>
<th>Market</th>
<th>Daily/Weekly/Monthly/Year period candlesticks</th>
<th>Minute candlesticks</th>
<th>Description</th>
</tr>
<tr>
<td>Hong Kong stocks</td>
<td>2004-06 to present</td>
<td>2008-11 to present</td>
<td rowspan="3">
<strong>The available history length for minute candlesticks varies based on the user's total assets:</strong><br />
(1) Total assets &lt; 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.<br />
(2) Total assets &ge; 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.<br />
For longer historical data coverage, please contact customer support.
</td>
</tr>
<tr>
<td>U.S. stocks</td>
<td>2010-06 to present</td>
<td>2003-09 to present</td>
</tr>
<tr>
<td>A shares</td>
<td>1999-11 to present</td>
<td>2022-08 to present</td>
</tr>
<tr>
<td>U.S. stock options</td>
<td>-</td>
<td>-</td>
<td>U.S. stock options historical data is currently not supported, and data for longer periods will be released later</td>
</tr>
</table>

## Rate limite

Expand Down
70 changes: 59 additions & 11 deletions docs/zh-CN/docs/quote/stocks/history-candlestick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 所有延长时段(盘前,盘中,盘后,夜盘)<br/><br/>注意:夜盘数据已包含在 US LV1 中免费提供,仅支持美股;开启 `enable_overnight` 参数即可获取 |
| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有延长时段(盘前,盘中,盘后,夜盘)<br/><br/>注意:夜盘数据已包含在 US LV1 中免费提供,仅支持美股;开启 `enable_overnight` 参数即可获取 |

### Protobuf

Expand Down Expand Up @@ -131,14 +131,34 @@ if __name__ == "__main__":
<TabItem value="nodejs" label="Node.js">

```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)
Expand Down Expand Up @@ -276,7 +296,6 @@ func main() {
</TabItem>
</Tabs>


## Response

### Response Properties
Expand Down Expand Up @@ -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 至今 | |
<table>
<tr>
<th>市场</th>
<th>日/周/月/年 K 线</th>
<th>分钟 K 线</th>
<th>说明</th>
</tr>
<tr>
<td>港股</td>
<td>2004-06 至今</td>
<td>2008-11 至今</td>
<td rowspan="3">
<strong>依据用户总资产,可查询的历史分钟 K 线时长如下:</strong><br />
(1)用户总资产 < 8 万港币:可查询近 3 年的历史分钟 K 线数据(按自然月计算,如当前为 2026 年 5 月,则可查 2023 年 5 月至今)。<br />
(2)用户总资产 ≥ 8 万港币:可查询近 8 年的历史分钟 K 线数据(按自然月计算,如当前为 2026 年 5 月,则可查 2018 年 5 月至今)。若实际数据不足 8 年,则支持查询自最早可用数据起的所有记录。<br />
如需查询更长周期的历史数据,可联系客服咨询。
</td>
</tr>
<tr>
<td>美股</td>
<td>2010-06 至今</td>
<td>2003-09 至今</td>
</tr>
<tr>
<td>A 股</td>
<td>1999-11 至今</td>
<td>2022-08 至今</td>
</tr>
<tr>
<td>美股期权</td>
<td>-</td>
<td>-</td>
<td>美股期权历史数据目前暂不支持,待后续开放更长时段的数据</td>
</tr>
</table>

## 频次限制

Expand Down
70 changes: 59 additions & 11 deletions docs/zh-HK/docs/quote/stocks/history-candlestick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 所有延長時段(盤前,盤中,盤後,夜盤)<br/><br/>注意:夜盤數據已包含在 US LV1 中免費提供,僅支援美股;開啟 `enable_overnight` 參數即可獲取 |
| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤)<br/><br/>注意:夜盤數據已包含在 US LV1 中免費提供,僅支援美股;開啟 `enable_overnight` 參數即可獲取 |

### Protobuf

Expand Down Expand Up @@ -131,14 +131,34 @@ if __name__ == "__main__":
<TabItem value="nodejs" label="Node.js">

```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)
Expand Down Expand Up @@ -276,7 +296,6 @@ func main() {
</TabItem>
</Tabs>


## Response

### Response Properties
Expand Down Expand Up @@ -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 至今 | |
<table>
<tr>
<th>市場</th>
<th>日/周/月/年 K 線</th>
<th>分鍾 K 線</th>
<th>說明</th>
</tr>
<tr>
<td>港股</td>
<td>2004-06 至今</td>
<td>2008-11 至今</td>
<td rowspan="3">
<strong>依據用戶總資產,可查詢的歷史分鐘 K 線時長如下:</strong><br />
(1)用戶總資產 < 8 萬港幣:可查詢近 3 年的歷史分鐘 K 線數據(按自然月計算,如當前為 2026 年 5 月,則可查 2023 年 5 月至今)。<br />
(2)用戶總資產 ≥ 8 萬港幣:可查詢近 8 年的歷史分鐘 K 線數據(按自然月計算,如當前為 2026 年 5 月,則可查 2018 年 5 月至今)。若實際數據不足 8 年,則支援查詢自最早可用數據起的所有記錄。<br />
如需查詢更長周期的歷史數據,可聯繫客服諮詢。
</td>
</tr>
<tr>
<td>美股</td>
<td>2010-06 至今</td>
<td>2003-09 至今</td>
</tr>
<tr>
<td>A 股</td>
<td>1999-11 至今</td>
<td>2022-08 至今</td>
</tr>
<tr>
<td>美股期權</td>
<td>-</td>
<td>-</td>
<td>美股期權曆史數據目前暫不支持,待後續開放更長時段的數據</td>
</tr>
</table>

## 頻次限製

Expand Down
Loading