From 45f71ff5684f629db96037ca2062a122338b478a Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 8 Apr 2026 15:55:48 +0800 Subject: [PATCH 1/3] docs(quote): clarify overnight quote requires LV1 quote card and US stocks only Add notes across all relevant docs (getting-started, qa/quote, pull/quote, candlestick, history-candlestick) in EN/zh-CN/zh-HK explaining that overnight quote data is not available by default, requires purchasing the "LV1 Real-time Quote (OpenAPI)" card in the Longbridge App, and is only supported for US stocks. Co-Authored-By: Claude Sonnet 4.6 --- docs/en/docs/getting-started.md | 2 +- docs/en/docs/qa/quote.md | 4 +++- docs/en/docs/quote/pull/candlestick.md | 2 +- docs/en/docs/quote/pull/history-candlestick.md | 2 +- docs/en/docs/quote/pull/quote.md | 2 +- docs/zh-CN/docs/getting-started.md | 2 +- docs/zh-CN/docs/qa/quote.md | 4 +++- docs/zh-CN/docs/quote/pull/candlestick.md | 2 +- docs/zh-CN/docs/quote/pull/history-candlestick.md | 2 +- docs/zh-CN/docs/quote/pull/quote.md | 2 +- docs/zh-HK/docs/getting-started.md | 2 +- docs/zh-HK/docs/qa/quote.md | 4 +++- docs/zh-HK/docs/quote/pull/candlestick.md | 2 +- docs/zh-HK/docs/quote/pull/history-candlestick.md | 2 +- docs/zh-HK/docs/quote/pull/quote.md | 2 +- 15 files changed, 21 insertions(+), 15 deletions(-) diff --git a/docs/en/docs/getting-started.md b/docs/en/docs/getting-started.md index c2b4cec9..8492b505 100644 --- a/docs/en/docs/getting-started.md +++ b/docs/en/docs/getting-started.md @@ -373,7 +373,7 @@ Please pay attention to protect your **Access Token** information, anyone who ge | `LONGBRIDGE_QUOTE_WS_URL` | Quote websocket endpoint url (Default: `wss://openapi-quote.longbridge.com/v2`) | | `LONGBRIDGE_TRADE_WS_URL` | Trade websocket endpoint url (Default: `wss://openapi-trade.longbridge.com/v2`) | | `LONGBRIDGE_REGION` | Override API region; SDK auto-selects by network. Set to `cn` or `hk` if incorrect. | -| `LONGBRIDGE_ENABLE_OVERNIGHT` | Enable overnight quote, `true` or `false` (Default: `false`) | +| `LONGBRIDGE_ENABLE_OVERNIGHT` | Enable overnight quote, `true` or `false` (Default: `false`). Requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card in the Longbridge App. US stocks only. | | `LONGBRIDGE_PUSH_CANDLESTICK_MODE` | `realtime` or `confirmed` (Default: `realtime`) | | `LONGBRIDGE_PRINT_QUOTE_PACKAGES` | Print quote packages when connected, `true` or `false` (Default: `true`) | | `LONGBRIDGE_LOG_PATH` | Set the path of the log files (Default: no logs) | diff --git a/docs/en/docs/qa/quote.md b/docs/en/docs/qa/quote.md index 8249bb34..6898d3ed 100644 --- a/docs/en/docs/qa/quote.md +++ b/docs/en/docs/qa/quote.md @@ -99,7 +99,9 @@ A: A: -- The night market quotation needs to be actively enabled by filling in the key `need_over_night_quote`, value `true` in the `metadata` field of the authentication interface. +- **Overnight quote data is not available by default.** You need to purchase the **"LV1 Real-time Quote (OpenAPI)"** quote card in the "Quote Store" of the Longbridge mobile app to access overnight data. +- Overnight quotes are currently **only available for US stocks**. Hong Kong stocks do not support overnight quotes. +- After obtaining the overnight quote permission, you still need to actively enable it by filling in the key `need_over_night_quote`, value `true` in the `metadata` field of the authentication interface. ```protobuf message AuthRequest { diff --git a/docs/en/docs/quote/pull/candlestick.md b/docs/en/docs/quote/pull/candlestick.md index 6ae0628a..63b495c3 100644 --- a/docs/en/docs/quote/pull/candlestick.md +++ b/docs/en/docs/quote/pull/candlestick.md @@ -38,7 +38,7 @@ longbridge kline NVDA.US --period day --count 20 | period | int32 | Yes | Candlestick period, for example: `1000`, see [Period](../objects#period---candlestick-period) | | count | int32 | Yes | Count of cancdlestick, for example: `100`

**Check rules:**
maximum count is `1000` | | adjust_type | int32 | Yes | Adjustment type, for example: `0`, see [AdjustType](../objects#adjusttype---candlestick-adjustment-type) | -| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight) | +| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight)

Note: Overnight data requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card. US stocks only. | ### Protobuf diff --git a/docs/en/docs/quote/pull/history-candlestick.md b/docs/en/docs/quote/pull/history-candlestick.md index bd7cc64c..28db853b 100644 --- a/docs/en/docs/quote/pull/history-candlestick.md +++ b/docs/en/docs/quote/pull/history-candlestick.md @@ -42,7 +42,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) | +| trade_session | int32 | No | Trading session, 0: intraday, 100: All (pre, intraday, post, overnight)

Note: Overnight data requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card. US stocks only. | ### Protobuf diff --git a/docs/en/docs/quote/pull/quote.md b/docs/en/docs/quote/pull/quote.md index 22f15e4a..95dc9b6b 100644 --- a/docs/en/docs/quote/pull/quote.md +++ b/docs/en/docs/quote/pull/quote.md @@ -266,7 +266,7 @@ func main() { | ∟∟ high | string | High | | ∟∟ low | string | Low | | ∟∟ prev_close | string | Close of the last trade session | -| ∟ over_night_quote | object | Quote of US overnight market | +| ∟ over_night_quote | object | Quote of US overnight market

Note: Requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card in the Longbridge App and enabling the `enable_overnight` parameter. Returns null otherwise. | | ∟∟ last_done | string | Latest price | | ∟∟ timestamp | int64 | Time of latest price | | ∟∟ volume | int64 | Volume | diff --git a/docs/zh-CN/docs/getting-started.md b/docs/zh-CN/docs/getting-started.md index 70b5111f..d61e035e 100644 --- a/docs/zh-CN/docs/getting-started.md +++ b/docs/zh-CN/docs/getting-started.md @@ -413,7 +413,7 @@ OAuth Token 应安全存储在应用程序中(如加密文件、安全密钥 | `LONGBRIDGE_QUOTE_WS_URL` | 行情 WebSocket 地址(默认:`wss://openapi-quote.longbridge.com/v2`) | | `LONGBRIDGE_TRADE_WS_URL` | 交易 WebSocket 地址(默认:`wss://openapi-trade.longbridge.com/v2`) | | `LONGBRIDGE_REGION` | 覆盖接入点;SDK 会按网络自动选择,若判断不正确可设置(如 `cn`、`hk`) | -| `LONGBRIDGE_ENABLE_OVERNIGHT` | 是否开启夜盘行情,`true` 或 `false`(默认:`false`) | +| `LONGBRIDGE_ENABLE_OVERNIGHT` | 是否开启夜盘行情,`true` 或 `false`(默认:`false`);需在 App 行情商店购买「LV1 实时行情 (OpenAPI)」行情卡,仅支持美股 | | `LONGBRIDGE_PUSH_CANDLESTICK_MODE` | K 线推送模式,`realtime` 或 `confirmed`(默认:`realtime`) | | `LONGBRIDGE_PRINT_QUOTE_PACKAGES` | 连接时是否打印行情包,`true` 或 `false`(默认:`true`) | | `LONGBRIDGE_LOG_PATH` | 日志文件路径(默认:不写日志) | diff --git a/docs/zh-CN/docs/qa/quote.md b/docs/zh-CN/docs/qa/quote.md index be1e733c..4c0c74fd 100644 --- a/docs/zh-CN/docs/qa/quote.md +++ b/docs/zh-CN/docs/qa/quote.md @@ -99,7 +99,9 @@ A: A: -- 夜盘行情需要主动开启,方式为在鉴权接口的 `metadata` 字段填充 key `need_over_night_quote`, value `true`。 +- **夜盘数据默认不包含**,需要在手机 Longbridge App 的「行情商店」购买 **「LV1 实时行情 (OpenAPI)」** 行情卡才能获取夜盘数据。 +- 目前夜盘行情**仅支持美股**,港股暂不支持夜盘。 +- 开通夜盘权限后,还需要主动开启,方式为在鉴权接口的 `metadata` 字段填充 key `need_over_night_quote`, value `true`。 ```protobuf message AuthRequest { diff --git a/docs/zh-CN/docs/quote/pull/candlestick.md b/docs/zh-CN/docs/quote/pull/candlestick.md index 6ba34c13..b0924f76 100644 --- a/docs/zh-CN/docs/quote/pull/candlestick.md +++ b/docs/zh-CN/docs/quote/pull/candlestick.md @@ -38,7 +38,7 @@ longbridge kline NVDA.US --period day --count 20 | period | int32 | 是 | k 线周期,例如:`1000`,详见 [Period](../objects#period---k-线周期) | | count | int32 | 是 | 数据数量,例如:`100`

**校验规则:**
请求数量最大为 `1000` | | adjust_type | int32 | 是 | 复权类型,例如:`0`,详见 [AdjustType](../objects#adjusttype---k-线复权类型) | -| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有(盘前,盘中,盘后,夜盘) | +| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有(盘前,盘中,盘后,夜盘)

注意:夜盘数据需购买「LV1 实时行情 (OpenAPI)」行情卡,且仅支持美股 | ### Protobuf diff --git a/docs/zh-CN/docs/quote/pull/history-candlestick.md b/docs/zh-CN/docs/quote/pull/history-candlestick.md index a583cc74..9cf82b9e 100644 --- a/docs/zh-CN/docs/quote/pull/history-candlestick.md +++ b/docs/zh-CN/docs/quote/pull/history-candlestick.md @@ -42,7 +42,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: 所有延長時段(盤前,盤中,盤後,夜盤) | +| trade_session | int32 | 否 | 交易时段,0: 盘中,100: 所有延长时段(盘前,盘中,盘后,夜盘)

注意:夜盘数据需购买「LV1 实时行情 (OpenAPI)」行情卡,且仅支持美股 | ### Protobuf diff --git a/docs/zh-CN/docs/quote/pull/quote.md b/docs/zh-CN/docs/quote/pull/quote.md index 15a17c2e..a1c0f674 100644 --- a/docs/zh-CN/docs/quote/pull/quote.md +++ b/docs/zh-CN/docs/quote/pull/quote.md @@ -266,7 +266,7 @@ func main() { | ∟∟ high | string | 最高价 | | ∟∟ low | string | 最低价 | | ∟∟ prev_close | string | 上一个交易阶段的收盘价 | -| ∟ overnight_quote | object | 美股夜盘交易行情

注意:需开启 `enable_overnight` 参数,否则会返回 null | +| ∟ overnight_quote | object | 美股夜盘交易行情

注意:需在 App 行情商店购买「LV1 实时行情 (OpenAPI)」行情卡并开启 `enable_overnight` 参数,否则会返回 null | | ∟∟ last_done | string | 最新价 | | ∟∟ timestamp | int64 | 最新成交的时间戳 | | ∟∟ volume | int64 | 成交量 | diff --git a/docs/zh-HK/docs/getting-started.md b/docs/zh-HK/docs/getting-started.md index 885c1f30..3b9426e7 100644 --- a/docs/zh-HK/docs/getting-started.md +++ b/docs/zh-HK/docs/getting-started.md @@ -371,7 +371,7 @@ OAuth Token 應安全儲存在應用程式中(如加密檔案、安全金鑰 | `LONGBRIDGE_QUOTE_WS_URL` | 行情 WebSocket 位址(預設:`wss://openapi-quote.longbridge.com/v2`) | | `LONGBRIDGE_TRADE_WS_URL` | 交易 WebSocket 位址(預設:`wss://openapi-trade.longbridge.com/v2`) | | `LONGBRIDGE_REGION` | 覆寫接入點;SDK 會依網路自動選擇,若判斷不正確可設定(如 `cn`、`hk`) | -| `LONGBRIDGE_ENABLE_OVERNIGHT` | 是否開啟夜盤行情,`true` 或 `false`(預設:`false`) | +| `LONGBRIDGE_ENABLE_OVERNIGHT` | 是否開啟夜盤行情,`true` 或 `false`(預設:`false`);需在 App 行情商店購買「LV1 實時行情 (OpenAPI)」行情卡,僅支援美股 | | `LONGBRIDGE_PUSH_CANDLESTICK_MODE` | K 線推送模式,`realtime` 或 `confirmed`(預設:`realtime`) | | `LONGBRIDGE_PRINT_QUOTE_PACKAGES` | 連線時是否列印行情包,`true` 或 `false`(預設:`true`) | | `LONGBRIDGE_LOG_PATH` | 日誌檔案路徑(預設:不寫日誌) | diff --git a/docs/zh-HK/docs/qa/quote.md b/docs/zh-HK/docs/qa/quote.md index 5b8a4588..e5f285d7 100644 --- a/docs/zh-HK/docs/qa/quote.md +++ b/docs/zh-HK/docs/qa/quote.md @@ -99,7 +99,9 @@ A: A: -- 夜盤行情需要主動開啟,方式為在鑑權接口的 `metadata` 欄位填入 key `need_over_night_quote`, value `true`。 +- **夜盤數據預設不包含**,需要在手機 Longbridge App 的「行情商店」購買 **「LV1 實時行情 (OpenAPI)」** 行情卡才能取得夜盤數據。 +- 目前夜盤行情**僅支援美股**,港股暫不支援夜盤。 +- 開通夜盤權限後,還需要主動開啟,方式為在鑑權接口的 `metadata` 欄位填入 key `need_over_night_quote`, value `true`。 ```protobuf message AuthRequest { diff --git a/docs/zh-HK/docs/quote/pull/candlestick.md b/docs/zh-HK/docs/quote/pull/candlestick.md index 61d5d5ab..6cc5fe7e 100644 --- a/docs/zh-HK/docs/quote/pull/candlestick.md +++ b/docs/zh-HK/docs/quote/pull/candlestick.md @@ -38,7 +38,7 @@ longbridge kline NVDA.US --period day --count 20 | period | int32 | 是 | k 線週期,例如:`1000`,详见 [Period](../objects#period---k-線週期) | | count | int32 | 是 | 數據數量,例如:`100`

**校验规则:**
請求數量最大為 `1000` | | adjust_type | int32 | 是 | 復權類型,例如:`0`,详见 [AdjustType](../objects#adjusttype---k-線復權類型) | -| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤) | +| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤)

注意:夜盤數據需購買「LV1 實時行情 (OpenAPI)」行情卡,且僅支援美股 | ### Protobuf diff --git a/docs/zh-HK/docs/quote/pull/history-candlestick.md b/docs/zh-HK/docs/quote/pull/history-candlestick.md index 7c6f4ac5..8f01cdcd 100644 --- a/docs/zh-HK/docs/quote/pull/history-candlestick.md +++ b/docs/zh-HK/docs/quote/pull/history-candlestick.md @@ -42,7 +42,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: 所有延長時段(盤前,盤中,盤後,夜盤) | +| trade_session | int32 | 否 | 交易時段,0: 盤中,100: 所有延長時段(盤前,盤中,盤後,夜盤)

注意:夜盤數據需購買「LV1 實時行情 (OpenAPI)」行情卡,且僅支援美股 | ### Protobuf diff --git a/docs/zh-HK/docs/quote/pull/quote.md b/docs/zh-HK/docs/quote/pull/quote.md index 884ff74d..5c343eb9 100644 --- a/docs/zh-HK/docs/quote/pull/quote.md +++ b/docs/zh-HK/docs/quote/pull/quote.md @@ -266,7 +266,7 @@ func main() { | ∟∟ high | string | 最高價 | | ∟∟ low | string | 最低價 | | ∟∟ prev_close | string | 上一個交易階段的收盤價 | -| ∟ over_night_quote | object | 美股夜盤交易行情 | +| ∟ over_night_quote | object | 美股夜盤交易行情

注意:需在 App 行情商店購買「LV1 實時行情 (OpenAPI)」行情卡並開啟 `enable_overnight` 參數,否則會返回 null | | ∟∟ last_done | string | 最新價 | | ∟∟ timestamp | int64 | 最新成交的時間戳 | | ∟∟ volume | int64 | 成交量 | From 450698bdad914bb6eacb0ccf5db08b36c691c50d Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 8 Apr 2026 16:07:34 +0800 Subject: [PATCH 2/3] docs(qa): improve Q&A content across general, quote, and trade pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove standalone "A:" prefixes from all QA answers (EN/zh-CN/zh-HK) - general Q1: rewrite answer, bold 模拟账户, add note recommending live account - general Q9: add new entry — accessing stock data without coding (CLI + MCP) - quote Q3: add TSLA.US example, remove redundant App screenshot - quote Q7: fix "OpenApi SDK" → "OpenAPI SDK" - trade Q6: restructure answer as bullet list, add CLI query option - Fix CLI doc links to /docs/cli across all QA files Co-Authored-By: Claude Sonnet 4.6 --- docs/en/docs/qa/general.md | 37 +++++++++++++++++++++++++++-------- docs/en/docs/qa/quote.md | 19 ++++-------------- docs/en/docs/qa/trade.md | 21 ++++++++++++-------- docs/zh-CN/docs/qa/general.md | 37 +++++++++++++++++++++++++++-------- docs/zh-CN/docs/qa/quote.md | 19 ++++-------------- docs/zh-CN/docs/qa/trade.md | 21 ++++++++++++-------- docs/zh-HK/docs/qa/general.md | 37 +++++++++++++++++++++++++++-------- docs/zh-HK/docs/qa/quote.md | 17 +++------------- docs/zh-HK/docs/qa/trade.md | 21 ++++++++++++-------- 9 files changed, 137 insertions(+), 92 deletions(-) diff --git a/docs/en/docs/qa/general.md b/docs/en/docs/qa/general.md index d8e0d168..5b4d4d8b 100644 --- a/docs/en/docs/qa/general.md +++ b/docs/en/docs/qa/general.md @@ -5,36 +5,57 @@ sidebar_position: 0 ## Q1: Do I need to open a live account to call Longbridge Developers? -A: We provide a paper account, you can use it to complete the debugging of the OpenAPI quote and trading interfaces. +No. The platform provides a **paper account** — you can develop and debug quote and trading interfaces without opening a real securities account. The **paper account** supports real-time quotes for HK, US, and A-share markets, as well as basic trading functionality for HK and US stocks and ETFs, making it suitable for API integration and feature verification. + +That said, the paper account differs from the live environment in areas such as order matching and cash rules. If you want to experience the platform's full capabilities, we recommend opening a live account as well. ## Q2: How to open a paper account for debugging? -A: Please visit [Development Center](https://open.longbridge.com/account/) to enable the paper account and obtain the corresponding App Key & Secret and Access Token. +Please visit [Development Center](https://open.longbridge.com/account/) to enable the paper account and obtain the corresponding App Key & Secret and Access Token. ## Q3: Are the trading permissions for simulation debugging the same as for real accounts? -A: Quote is the same, trading might be different. +Quote is the same, trading might be different. Paper accounts and live accounts share the same App Key & Secret, but have different Access Tokens. Quote permissions are associated with the App Key & Secret, while trading permissions are associated with the Access Token. Therefore, under paper accounts and live accounts, quote permissions are the same, but trading permissions are associated with the securities account and may differ. ## Q4: Which markets and types of securities are supported for quote and trading in paper account debugging? -A: Market: Supports real-time market data for Hong Kong stocks, US stocks, and A-share markets. For advanced market data such as full US market data and Hong Kong Level2 data, they can be purchased through the online market store and accessed via OpenAPI. +Market: Supports real-time market data for Hong Kong stocks, US stocks, and A-share markets. For advanced market data such as full US market data and Hong Kong Level2 data, they can be purchased through the online market store and accessed via OpenAPI. Trading: Supports trading of Hong Kong and US stocks, ETFs, and Hong Kong warrant trading. Short selling is supported for US stocks. OTC stocks, pre & post market trading, and options trading are not supported in paper accounts. ## Q5: Interface call frequency limits -A: Please visit [Rate Limit](docs/#rate-limit) for specific descriptions. +Please visit [Rate Limit](docs/#rate-limit) for specific descriptions. ## Q6: How are interface call frequency limits applied in the case of multiple accounts? -A: If a customer holds multiple securities accounts, such as intraday financing or other sub-accounts, the trading interface call frequency limits are calculated and controlled based on different securities accounts, while quote interface calls are not affected by multiple accounts and are uniformly limited. +If a customer holds multiple securities accounts, such as intraday financing or other sub-accounts, the trading interface call frequency limits are calculated and controlled based on different securities accounts, while quote interface calls are not affected by multiple accounts and are uniformly limited. ## Q7: Are there additional charges for trading operations through Longbridge Developers? -A: We do not charge additional fees for accessing market queries, trading, etc., via OpenAPI. For account-related fees such as trading commissions, platform fees, and market permissions, please refer to the information provided by the app and the official website. +We do not charge additional fees for accessing market queries, trading, etc., via OpenAPI. For account-related fees such as trading commissions, platform fees, and market permissions, please refer to the information provided by the app and the official website. ## Q8: How to disable the permission table output in the console after the SDK connects to the server? -A: You can set the environment variable `LONGBRIDGE_PRINT_QUOTE_PACKAGES` to `false` (or legacy `LONGPORT_PRINT_QUOTE_PACKAGES`), or set `enable_print_quote_packages` to `false` when creating the `Config` object in the code to disable the permission table output in the console. +You can set the environment variable `LONGBRIDGE_PRINT_QUOTE_PACKAGES` to `false` (or legacy `LONGPORT_PRINT_QUOTE_PACKAGES`), or set `enable_print_quote_packages` to `false` when creating the `Config` object in the code to disable the permission table output in the console. + +## Q9: I don't know how to code. How can I access stock data from the Longbridge Developers platform? + +The platform offers two ways to access stock data without writing any code: + +**CLI (Command-line Tool)** + +Install the [Longbridge Terminal CLI](/docs/cli) and query market data with simple commands — no programming required: + +```bash +longbridge quote AAPL.US TSLA.US +longbridge static NVDA.US +``` + +**MCP (AI Tool Integration)** + +If you use AI tools like Claude, Cursor, or ChatGPT, connect the [Longbridge MCP service](/mcp). Once configured, simply ask in plain language and the AI will query market data on your behalf. + +Both methods require a Longbridge account. diff --git a/docs/en/docs/qa/quote.md b/docs/en/docs/qa/quote.md index 6898d3ed..2a063d37 100644 --- a/docs/en/docs/qa/quote.md +++ b/docs/en/docs/qa/quote.md @@ -7,15 +7,15 @@ sidebar_position: 1 ## Q1: How to calculate the subscription quote, is it one or more subscriptions if I both subscribe depth and broker with the same security? -A: The subscription quote is only calculated according to the security dimension, only one subscription will be calculted if you subscribe muilty quote type with one security. +The subscription quote is only calculated according to the security dimension, only one subscription will be calculted if you subscribe muilty quote type with one security. ## Q2: What is the specific limit logic for request frequency limit? -A: Use the token bucket to limit request and control the request rate. No more than 10 calls in 1 second, and no more than 5 concurrent requests. +Use the token bucket to limit request and control the request rate. No more than 10 calls in 1 second, and no more than 5 concurrent requests. ## Q3: What is the available subscribing securities and corresponding symbol formats? -A: The security code uses the `ticker.region` format, `ticker` represents the code. Aavailable subscribing securities are as followes. +The security code uses the `ticker.region` format, `ticker` represents the code — for example, Tesla is `TSLA.US`. Available subscribing securities are as follows. @@ -74,13 +74,8 @@ A: The security code uses the `ticker.region` format, `ticker` represents the co
-You can also use Longbridge App to find the symbol of security - - ## Q4: What is the quote authority of OpenAPI? How to buy quote cards? -A: - - Quote Authority In accordance with the rules of the exchange, the authority of OpenAPI are independent, and are not shared with App, PC, or Web permissions. For example, the Hong Kong stock Level 2 authority you have on the App cannot be used on the OpenAPI side. Longbridge also presents basic market rights to OpenAPI users. If you need a higher-level market, you can activate the high-level quote authority by purchasing a market card through on-line Quote Store of brokers or Longbridge. - How to buy quote cards @@ -88,8 +83,6 @@ A: ## Q5: Quote Change By Date Time -A: - - US Market: 09:20:00 EDT/EST - HK Market: 08:50:00 CST - CN Market: 09:00:00 CST @@ -97,8 +90,6 @@ A: ## Q6: How to enable Overnight quote -A: - - **Overnight quote data is not available by default.** You need to purchase the **"LV1 Real-time Quote (OpenAPI)"** quote card in the "Quote Store" of the Longbridge mobile app to access overnight data. - Overnight quotes are currently **only available for US stocks**. Hong Kong stocks do not support overnight quotes. - After obtaining the overnight quote permission, you still need to actively enable it by filling in the key `need_over_night_quote`, value `true` in the `metadata` field of the authentication interface. @@ -117,9 +108,7 @@ message ReconnectRequest { - After turning on the night trading quotations, both the pull and push interfaces will be able to obtain the night trading quotations during the night trading period. -## Q7: Enable Overnight quote in OpenApi SDK - -A: +## Q7: Enable Overnight quote in OpenAPI SDK - Create `Config` from environment variables diff --git a/docs/en/docs/qa/trade.md b/docs/en/docs/qa/trade.md index d4fddc98..576556fc 100644 --- a/docs/en/docs/qa/trade.md +++ b/docs/en/docs/qa/trade.md @@ -5,34 +5,39 @@ sidebar_position: 2 ## Q1: What types of orders are supported? -A: Both paper and live accounts support regular Limit orders, Market orders, and Conditional orders (such as Buy if touched, Sell if touched, etc.), but do not currently support Attached orders and Grid orders. +Both paper and live accounts support regular Limit orders, Market orders, and Conditional orders (such as Buy if touched, Sell if touched, etc.), but do not currently support Attached orders and Grid orders. ## Q2: What are the trading hours for paper accounts? -A: Trading hours for paper accounts for Hong Kong stocks are the same as in the real environment. Trading pre & post market is not supported for U.S. stocks in the paper environment, only regular trading hours are supported. +Trading hours for paper accounts for Hong Kong stocks are the same as in the real environment. Trading pre & post market is not supported for U.S. stocks in the paper environment, only regular trading hours are supported. ## Q3: How can I trade overnight sessions for U.S. stocks? -A: To place orders for overnight trading, you can specify overnight trading by passing the OVERNIGHT value to the `outside_rth` parameter in the order placement API. +To place orders for overnight trading, you can specify overnight trading by passing the OVERNIGHT value to the `outside_rth` parameter in the order placement API. ## Q4: What are the trading rules for paper accounts? -A: Paper accounts currently support trading in Hong Kong and U.S. stocks, ETFs, and Hong Kong warrants. Short selling is supported for U.S. stocks. However, OTC trading, pre & post market trading, and options trading are not supported in paper accounts. +Paper accounts currently support trading in Hong Kong and U.S. stocks, ETFs, and Hong Kong warrants. Short selling is supported for U.S. stocks. However, OTC trading, pre & post market trading, and options trading are not supported in paper accounts. Trades in the paper environment are matched based on the bid-ask spread from the real market. If the buy order price is higher than or equal to the ask price and the sell order price is lower than or equal to the bid price, a trade can be executed. Market orders are matched by default. ## Q5: How can I reset the funds in my paper account? -A: Manual resetting of demo funds is not supported at the moment. If needed, please contact your customer service or account manager for offline processing. +Manual resetting of demo funds is not supported at the moment. If needed, please contact your customer service or account manager for offline processing. ## Q6: After placing orders through the OpenAPI, how can I view them? -A: After placing orders through the OpenAPI, you can check the real-time status of orders by calling the order inquiry API. Alternatively, you can receive order update information through WebSocket push. You can also view orders and their statuses directly through the App/PC or other terminal products. +After placing orders via the OpenAPI, you can view them through any of the following: + +- **Order inquiry API**: Call the API to query real-time order status +- **WebSocket push**: Subscribe to trade push events to receive order updates in real time +- **CLI**: Use the [Longbridge Terminal CLI](/docs/cli) to query from the command line, e.g. `longbridge orders` +- **App / PC**: View orders and their statuses directly in the terminal products ## Q7: How can I know if my account has sufficient funds for trading? -A: You can use the trading API `/v1/trade/estimate/buy_limit` to estimate the available cash & margin buying power, and short selling quantity in your account. Due to the complexity of risk control requirements, it's not recommended to calculate the tradable quantity manually. +You can use the trading API `/v1/trade/estimate/buy_limit` to estimate the available cash & margin buying power, and short selling quantity in your account. Due to the complexity of risk control requirements, it's not recommended to calculate the tradable quantity manually. ## Q8: What does it mean when the order placement API returns "User authentication failed"? -A: This error usually indicates that the user does not have permission for the corresponding trading operation, such as options trading or short selling U.S. stocks. You can complete the permission opening process guided by the order placement in the app. After obtaining the necessary permissions, you can continue trading or performing other operations through OpenAPI. +This error usually indicates that the user does not have permission for the corresponding trading operation, such as options trading or short selling U.S. stocks. You can complete the permission opening process guided by the order placement in the app. After obtaining the necessary permissions, you can continue trading or performing other operations through OpenAPI. diff --git a/docs/zh-CN/docs/qa/general.md b/docs/zh-CN/docs/qa/general.md index b88d1d9f..bafb374c 100644 --- a/docs/zh-CN/docs/qa/general.md +++ b/docs/zh-CN/docs/qa/general.md @@ -5,36 +5,57 @@ sidebar_position: 0 ## Q1: 一定要开通真实账户才能调用 Longbridge Developers 吗? -A: 我们已提供了模拟账户,您可以用模拟账户来完成 OpenAPI 的行情和交易接口调试。 +不需要。平台提供**模拟账户**,无需开通真实证券账户即可完成行情与交易接口的开发调试。**模拟账户**支持港股、美股、A 股实时行情查询,以及港美股股票、ETF 等基础交易功能,适合接口联调与功能验证。 + +不过,模拟账户在交易撮合、资金规则等方面与真实环境存在差异,如需完整体验平台能力,建议同时开通真实账户。 ## Q2: 如何开通模拟账户调试? -A: 请访问 [开发者中心](https://open.longbridge.com/account/) 开启**模拟账户**并获得模拟账户对应的 App Key & Secret 以及 Access Token 等信息。 +请访问 [开发者中心](https://open.longbridge.com/account/) 开启**模拟账户**并获得模拟账户对应的 App Key & Secret 以及 Access Token 等信息。 ## Q3: 模拟调试的行情交易权限与真实账户相同吗? -A: 行情相同,交易不同。 +行情相同,交易不同。 模拟账户和真实账户共用 App Key & Secret,不同 Access Token。其中,行情权限与 App Key & Secret 关联,交易权限与 Access Token 关联,因此模拟账户和真实账户下,行情权限相同,交易权限与证券账号关联,可能会不同。 ## Q4: 模拟调试支持哪些市场和品种的行情和交易 -A: 行情:支持港股、美股、A 股通市场实时行情,其中,美股全美行情、港股 Level2 等高级行情也可通过在线行情商店购买对应行情权益后,通过 OpenAPI 获取行情数据。 +行情:支持港股、美股、A 股通市场实时行情,其中,美股全美行情、港股 Level2 等高级行情也可通过在线行情商店购买对应行情权益后,通过 OpenAPI 获取行情数据。 交易:支持港美股股票、ETF、港股轮证交易,其中美股支持股票做空。美股 OTC、盘前盘后交易、期权交易在模拟账号下暂未支持。 ## Q5: 接口调用频次及数量限制 -A: 请访问 [频率限制](/docs/#rate-limit) 查看具体描述。 +请访问 [频率限制](/docs/#rate-limit) 查看具体描述。 ## Q6: 多个账户情况下,接口调用频次如何限制 -A: 若客户持有多个证券账户,例如日内融或其他子账户,交易接口调用频次和数量限制按不同的证券账户统计和控制,行情接口则不受多账户影响,统一限制。 +若客户持有多个证券账户,例如日内融或其他子账户,交易接口调用频次和数量限制按不同的证券账户统计和控制,行情接口则不受多账户影响,统一限制。 ## Q7: 通过 Longbridge Developers 进行交易操作有额外收费吗 -A: 通过 OpenAPI 接入进行行情查询、交易等,我们不会收取额外的费用。交易手续费、平台费、行情权限等账户相关的费用,请以 App 以及官网提供的信息为准。 +通过 OpenAPI 接入进行行情查询、交易等,我们不会收取额外的费用。交易手续费、平台费、行情权限等账户相关的费用,请以 App 以及官网提供的信息为准。 ## Q8: 如何关闭 SDK 连接到服务器后的控制台下的权限表输出 -A: 您可以设置环境变量 `LONGBRIDGE_PRINT_QUOTE_PACKAGES` 为 `false`(或旧版 `LONGPORT_PRINT_QUOTE_PACKAGES`),或在代码中创建 `Config` 对象时设置 `enable_print_quote_packages` 为 `false`,来关闭控制台下的权限表输出。 +您可以设置环境变量 `LONGBRIDGE_PRINT_QUOTE_PACKAGES` 为 `false`(或旧版 `LONGPORT_PRINT_QUOTE_PACKAGES`),或在代码中创建 `Config` 对象时设置 `enable_print_quote_packages` 为 `false`,来关闭控制台下的权限表输出。 + +## Q9: 我不会编程,如何才能访问 Longbridge Developers 平台的个股数据? + +平台提供两种无需编程即可访问个股数据的方式: + +**CLI(命令行工具)** + +安装 [Longbridge Terminal CLI](/docs/cli),通过简单命令即可查询行情数据,无需编写任何代码: + +```bash +longbridge quote AAPL.US TSLA.US +longbridge static NVDA.US +``` + +**MCP(AI 工具集成)** + +如果你日常使用 Claude、Cursor、ChatGPT 等 AI 工具,可以接入 [Longbridge MCP 服务](/mcp),配置完成后直接用自然语言向 AI 提问,由 AI 代你调用行情接口获取数据。 + +两种方式均需拥有 Longbridge 账户。 diff --git a/docs/zh-CN/docs/qa/quote.md b/docs/zh-CN/docs/qa/quote.md index 4c0c74fd..0c3461b4 100644 --- a/docs/zh-CN/docs/qa/quote.md +++ b/docs/zh-CN/docs/qa/quote.md @@ -7,15 +7,15 @@ sidebar_position: 1 ## Q1:订阅额度怎么算的,同一个标的订阅盘口,经济队列,是算 1 个还是多个? -A:仅按照标的维度计算订阅额度,同一个标的同时订阅多种行情,算同一个订阅额度。 +仅按照标的维度计算订阅额度,同一个标的同时订阅多种行情,算同一个订阅额度。 ## Q2:请求限频的具体限制逻辑是怎样? -A:使用令牌桶进行限流,控制请求速率。1 秒内不超过 10 次调用,并发请求数不超过 5。 +使用令牌桶进行限流,控制请求速率。1 秒内不超过 10 次调用,并发请求数不超过 5。 ## Q3:目前可以订阅的标的(包括指数)和对应的 symbol 格式? -A:标的代码使用 `ticker.region` 格式,`ticker` 表示标的代码。支持订阅的标的如下: +标的代码使用 `ticker.region` 格式,`ticker` 表示标的代码,例如特斯拉美股为 `TSLA.US`。支持订阅的标的如下: @@ -74,13 +74,8 @@ A:标的代码使用 `ticker.region` 格式,`ticker` 表示标的代码。
-可以使用 Longbridge App 查看标的的 symbol - - ## Q4:OpenAPI 的行情权限是怎么样?如何购买行情卡? -A: - - 行情权限 应交易所规则,OpenAPI 的权限是独立的,和客户端(App、PC、Web)权限不共享。比如,你在客户端上拥有的港股 Level 2 权限并不能同样代入 OpenAPI 端使用。Longbridge 也给 OpenAPI 用户赠送了基础的行情权益,如你需要更高级别的行情,可以通过券商行情商店,或联系券商购买行情卡激活高级别行情权限。 - 如何购买行情卡 @@ -88,8 +83,6 @@ A: ## Q5:各个市场的清盘时间 -A: - - 美股市场:09:20:00 EST - 港股市场:08:50:00 CST - A 股市场:09:00:00 CST @@ -97,8 +90,6 @@ A: ## Q6:如何获取夜盘行情 -A: - - **夜盘数据默认不包含**,需要在手机 Longbridge App 的「行情商店」购买 **「LV1 实时行情 (OpenAPI)」** 行情卡才能获取夜盘数据。 - 目前夜盘行情**仅支持美股**,港股暂不支持夜盘。 - 开通夜盘权限后,还需要主动开启,方式为在鉴权接口的 `metadata` 字段填充 key `need_over_night_quote`, value `true`。 @@ -117,9 +108,7 @@ message ReconnectRequest { - 开启夜盘行情后,拉取和推送接口都将可以在夜盘交易时段,获取到夜盘盘情。 -## Q7:OpenApi SDK 中开启夜盘行情 - -A: +## Q7:OpenAPI SDK 中开启夜盘行情 -  从环境变量创建 `Config` 对象 diff --git a/docs/zh-CN/docs/qa/trade.md b/docs/zh-CN/docs/qa/trade.md index 249e82c6..cb612d79 100644 --- a/docs/zh-CN/docs/qa/trade.md +++ b/docs/zh-CN/docs/qa/trade.md @@ -5,34 +5,39 @@ sidebar_position: 2 ## Q1: 支持哪些订单类型? -A: 模拟账户和真实账户均支持普通限价单、市价单及到价买入、到价卖出等条件订单,暂不支持附加订单及网格订单。 +模拟账户和真实账户均支持普通限价单、市价单及到价买入、到价卖出等条件订单,暂不支持附加订单及网格订单。 ## Q2: 模拟账户交易时间有哪些? -A: 模拟账户港股时间与真实环境相同,美股暂未支持盘前盘后交易,仅支持常规交易时段模拟撮合。 +模拟账户港股时间与真实环境相同,美股暂未支持盘前盘后交易,仅支持常规交易时段模拟撮合。 ## Q3: 如何进美股夜盘交易? -A: 委托下单接口通过 `outside_rth` 参数传递 [OVERNIGHT](/docs/trade/order/submit#parameters) 枚举即为指定夜盘交易的订单。 +委托下单接口通过 `outside_rth` 参数传递 [OVERNIGHT](/docs/trade/order/submit#parameters) 枚举即为指定夜盘交易的订单。 ## Q4: 模拟账户下的交易规则? -A: 模拟账户目前支持港美股股票、ETF、港股轮证交易,其中美股支持股票做空。美股 OTC、盘前盘后交易、期权交易在模拟账号下暂未支持。 +模拟账户目前支持港美股股票、ETF、港股轮证交易,其中美股支持股票做空。美股 OTC、盘前盘后交易、期权交易在模拟账号下暂未支持。 模拟交易参考真实市场买卖摆盘进行撮合,即当委托买入价高于等于摆盘卖一价、委托卖出价低于等于摆盘买一价,即可撮合成交,市价单默认均可成交。 ## Q5: 如何重置模拟账户资金? -A: 暂不支持用户手动重置模拟资金,如有需求可联系您的客服或客户经理,进行线下处理。 +暂不支持用户手动重置模拟资金,如有需求可联系您的客服或客户经理,进行线下处理。 ## Q6: 通过 OpenAPI 下单后,我如何看到订单? -A: 经 OpenAPI 委托订单后,可通过调用订单查询接口,查询订单实时状态,或通过对接 WebSocket 推送接收订单更新信息,也可以通过 App/PC 等终端产品直接查看对应账户下的订单及其状态。 +经 OpenAPI 委托订单后,可通过以下方式查看订单: + +- **订单查询接口**:调用 API 查询订单实时状态 +- **WebSocket 推送**:订阅交易推送,实时接收订单更新 +- **CLI**:通过 [Longbridge Terminal CLI](/docs/cli) 在命令行查询,例如 `longbridge orders` +- **App / PC**:直接在终端产品中查看对应账户下的订单及其状态 ## Q7: 如何知道账户资金是否足够交易? -A: 可调用交易类接口 `/v1/trade/estimate/buy_limit` 获取账户现金可买、融资可买及可卖空的数量,因系统风控要求逻辑复杂,不建议自己计算可交易数量。 +可调用交易类接口 `/v1/trade/estimate/buy_limit` 获取账户现金可买、融资可买及可卖空的数量,因系统风控要求逻辑复杂,不建议自己计算可交易数量。 ## Q8: 下单接口返回“用户认证失败”什么意思? -A: 通常是对应交易业务的权限暂未开通,例如期权、美股卖空等。可通过 App 委托挂单引导的权限开通流程,完成权限开通后,继续通过 OpenAPI 完成交易或其他操作。 +通常是对应交易业务的权限暂未开通,例如期权、美股卖空等。可通过 App 委托挂单引导的权限开通流程,完成权限开通后,继续通过 OpenAPI 完成交易或其他操作。 diff --git a/docs/zh-HK/docs/qa/general.md b/docs/zh-HK/docs/qa/general.md index c7cae377..7ffbc154 100644 --- a/docs/zh-HK/docs/qa/general.md +++ b/docs/zh-HK/docs/qa/general.md @@ -5,36 +5,57 @@ sidebar_position: 0 ## Q1: 一定要開通真實帳號才能呼叫 Longbridge Developers 嗎? -A: 我們已提供了模擬帳戶,你可以用模擬帳戶來完成 OpenAPI 的行情和交易介面偵錯。 +不需要。平台提供**模擬帳戶**,無需開通真實證券帳戶即可完成行情與交易介面的開發偵錯。**模擬帳戶**支援港股、美股、A 股即時行情查詢,以及港美股股票、ETF 等基礎交易功能,適合介面聯調與功能驗證。 + +不過,模擬帳戶在交易撮合、資金規則等方面與真實環境存在差異,如需完整體驗平台能力,建議同時開通真實帳戶。 ## Q2: 如何開通模擬帳戶調試? -A: 請造訪 [開發者中心](https://open.longbridge.com/account/) 開啟**模擬帳號**並取得模擬帳號對應的 App Key & Secret 以及 Access Token 等資訊。 +請造訪 [開發者中心](https://open.longbridge.com/account/) 開啟**模擬帳號**並取得模擬帳號對應的 App Key & Secret 以及 Access Token 等資訊。 ## Q3: 模擬偵錯的行情交易權限與真實帳戶相同嗎? -A: 行情相同,交易不同。 +行情相同,交易不同。 模擬帳號和真實帳號共用 App Key & Secret,不同 Access Token。其中,行情權限與 App Key & Secret 關聯,交易權限與 Access Token 關聯,因此模擬帳戶和真實帳戶下,行情權限相同,交易權限與證券帳號關聯,可能會不同。 ## Q4: 模擬調試支援哪些市場和品種的行情和交易 -A: 行情:支援港股、美股、A 股通市場即時行情,其中,美股全美行情、港股 Level2 等高級行情也可透過線上行情商店購買對應行情權益後,透過 OpenAPI 取得行情資料。 +行情:支援港股、美股、A 股通市場即時行情,其中,美股全美行情、港股 Level2 等高級行情也可透過線上行情商店購買對應行情權益後,透過 OpenAPI 取得行情資料。 交易:支持港美股股票、ETF、港股輪證交易,其中美股支持股票做空。美股 OTC、盤前盤後交易、選擇權交易在模擬帳號下暫未支援。 ## Q5: 介面呼叫頻次及數量限制 -A: 請造訪 [頻率限制](/docs/#rate-limit) 查看具體描述。 +請造訪 [頻率限制](/docs/#rate-limit) 查看具體描述。 ## Q6: 多個帳戶情況下,介面呼叫頻次如何限制 -A: 若客戶持有多個證券帳戶,例如日內融或其他子帳戶,交易介面呼叫頻次及數量限制依不同的證券帳戶統計及控制,行情介面則不受多帳戶影響,統一限制。 +若客戶持有多個證券帳戶,例如日內融或其他子帳戶,交易介面呼叫頻次及數量限制依不同的證券帳戶統計及控制,行情介面則不受多帳戶影響,統一限制。 ## Q7: 透過 Longbridge Developers 進行交易操作有額外收費嗎 -A: 透過 OpenAPI 存取進行行情查詢、交易等,我們不會收取額外的費用。交易手續費、平台費、行情權限等帳戶相關的費用,請以 App 以及官網提供的資訊為準。 +透過 OpenAPI 存取進行行情查詢、交易等,我們不會收取額外的費用。交易手續費、平台費、行情權限等帳戶相關的費用,請以 App 以及官網提供的資訊為準。 ## Q8: 如何關閉 SDK 連接到伺服器後的控制台下的權限表輸出 -A: 您可以設置環境變數 `LONGBRIDGE_PRINT_QUOTE_PACKAGES` 為 `false`(或舊版 `LONGPORT_PRINT_QUOTE_PACKAGES`),或在代碼中創建 `Config` 對象時設置 `enable_print_quote_packages` 為 `false`,來關閉控制台下的權限表輸出。 +您可以設置環境變數 `LONGBRIDGE_PRINT_QUOTE_PACKAGES` 為 `false`(或舊版 `LONGPORT_PRINT_QUOTE_PACKAGES`),或在代碼中創建 `Config` 對象時設置 `enable_print_quote_packages` 為 `false`,來關閉控制台下的權限表輸出。 + +## Q9: 我不會寫程式,如何才能存取 Longbridge Developers 平台的個股數據? + +平台提供兩種無需寫程式即可存取個股數據的方式: + +**CLI(命令列工具)** + +安裝 [Longbridge Terminal CLI](/docs/cli),透過簡單指令即可查詢行情數據,無需撰寫任何程式碼: + +```bash +longbridge quote AAPL.US TSLA.US +longbridge static NVDA.US +``` + +**MCP(AI 工具整合)** + +如果你日常使用 Claude、Cursor、ChatGPT 等 AI 工具,可以接入 [Longbridge MCP 服務](/mcp),設定完成後直接用自然語言向 AI 提問,由 AI 代你呼叫行情介面取得數據。 + +兩種方式均需擁有 Longbridge 帳戶。 diff --git a/docs/zh-HK/docs/qa/quote.md b/docs/zh-HK/docs/qa/quote.md index e5f285d7..c3bc4c19 100644 --- a/docs/zh-HK/docs/qa/quote.md +++ b/docs/zh-HK/docs/qa/quote.md @@ -7,15 +7,15 @@ sidebar_position: 1 ## Q1:訂閱額度怎麼算的,同一個標的訂閱盤口,經濟隊列,是算 1 個還是多個? -A:僅按照標的維度計算訂閱額度,同一個標的同時訂閱多種行情,算同一個訂閱額度。 +僅按照標的維度計算訂閱額度,同一個標的同時訂閱多種行情,算同一個訂閱額度。 ## Q2:請求限頻的具體限制邏輯是怎樣? -A:使用令牌桶進行限流,控制請求速率。1 秒內不超過 10 次調用,並發請求數不超過 5。 +使用令牌桶進行限流,控制請求速率。1 秒內不超過 10 次調用,並發請求數不超過 5。 ## Q3:目前可以訂閱的標的(包括指數)和對應的 symbol 格式? -A:標的代碼使用 `ticker.region` 格式,`ticker` 表示標的代碼。支持訂閱的標的如下: +標的代碼使用 `ticker.region` 格式,`ticker` 表示標的代碼,例如特斯拉美股為 `TSLA.US`。支持訂閱的標的如下: @@ -74,13 +74,8 @@ A:標的代碼使用 `ticker.region` 格式,`ticker` 表示標的代碼。
-可以使用 Longbridge App 查看標的的 symbol - - ## Q4:OpenAPI 的行情权限是怎么样?如何购买行情卡? -A: - - 行情權限 應交易所規則,OpenAPI 的權限是獨立的,和客戶端(App、PC、Web)權限不共享。比如,你在客戶端上擁有的港股 Level 2 權限並不能同樣代入 OpenAPI 端使用。Longbridge 也給 OpenAPI 用戶贈送了基礎的行情權益,如你需要更高級別的行情,可以通過券商行情商店,或聯繫券商購買行情卡激活高級別行情權限。 - 如何購買行情卡 @@ -88,8 +83,6 @@ A: ## Q5:各個市場的清盤時間 -A: - - 美股市場:09:20:00 EDT/EST - 港股市場:08:50:00 CST - A 股市場:09:00:00 CST @@ -97,8 +90,6 @@ A: ## Q6:如何取得夜盤行情 -A: - - **夜盤數據預設不包含**,需要在手機 Longbridge App 的「行情商店」購買 **「LV1 實時行情 (OpenAPI)」** 行情卡才能取得夜盤數據。 - 目前夜盤行情**僅支援美股**,港股暫不支援夜盤。 - 開通夜盤權限後,還需要主動開啟,方式為在鑑權接口的 `metadata` 欄位填入 key `need_over_night_quote`, value `true`。 @@ -119,8 +110,6 @@ message ReconnectRequest { ## Q7:如何開啟夜盤行情 -A: - - 從環境變數建立 `Config` 對象 設定環境變數 `LONGBRIDGE_ENABLE_OVERNIGHT` 為 `true`(相容舊版 `LONGPORT_ENABLE_OVERNIGHT`) diff --git a/docs/zh-HK/docs/qa/trade.md b/docs/zh-HK/docs/qa/trade.md index a7fcd369..f6dc9f4a 100644 --- a/docs/zh-HK/docs/qa/trade.md +++ b/docs/zh-HK/docs/qa/trade.md @@ -5,34 +5,39 @@ sidebar_position: 2 ## Q1: 支持哪些訂單類型? -A: 模擬帳戶和真實帳戶均支持普通限價單、市價單及條件單(如到價買入、到價賣出等),暫不支持附加訂單及網格訂單。 +模擬帳戶和真實帳戶均支持普通限價單、市價單及條件單(如到價買入、到價賣出等),暫不支持附加訂單及網格訂單。 ## Q2: 模擬帳戶交易時間有哪些? -A: 模擬帳戶港股時間與真實環境相同,美股暫不支援盤前盤後交易,僅支援常規交易時段模擬撮合。 +模擬帳戶港股時間與真實環境相同,美股暫不支援盤前盤後交易,僅支援常規交易時段模擬撮合。 ## Q3: 如何進行美股夜盤交易? -A: 委託下單接口可透過外部參數 `outside_rth` 傳遞枚舉值 `OVERNIGHT` 以指定夜盤交易的訂單。 +委託下單接口可透過外部參數 `outside_rth` 傳遞枚舉值 `OVERNIGHT` 以指定夜盤交易的訂單。 ## Q4: 模擬帳戶的交易規則? -A: 模擬帳戶目前支援港美股股票、ETF、港股輪證交易,其中美股支援股票做空。美股場外交易、盤前盤後交易和期權交易在模擬帳戶下暫不支援。 +模擬帳戶目前支援港美股股票、ETF、港股輪證交易,其中美股支援股票做空。美股場外交易、盤前盤後交易和期權交易在模擬帳戶下暫不支援。 模擬交易參考真實市場買賣檔進行撮合,即當委託買入價高於等於買一價、委託賣出價低於等於賣一價時,即可撮合成交,市價單默認均可成交。 ## Q5: 如何重置模擬帳戶資金? -A: 目前不支援用戶手動重置模擬資金,如有需要,請聯繫您的客服或客戶經理進行線下處理。 +目前不支援用戶手動重置模擬資金,如有需要,請聯繫您的客服或客戶經理進行線下處理。 ## Q6: 通過 OpenAPI 下單後,我如何查看訂單? -A: 下單後,您可以調用訂單查詢接口查詢訂單的實時狀態,或通過 WebSocket 推送接收訂單更新信息,也可透過 App/PC 等終端產品直接查看相應帳戶下的訂單及其狀態。 +經 OpenAPI 委託訂單後,可透過以下方式查看訂單: + +- **訂單查詢接口**:調用 API 查詢訂單即時狀態 +- **WebSocket 推送**:訂閱交易推送,即時接收訂單更新 +- **CLI**:透過 [Longbridge Terminal CLI](/docs/cli) 在命令列查詢,例如 `longbridge orders` +- **App / PC**:直接在終端產品中查看對應帳戶下的訂單及其狀態 ## Q7: 如何確定帳戶資金是否足夠進行交易? -A: 您可以調用交易類接口 `/v1/trade/estimate/buy_limit` 以獲取帳戶現金可買、融資可買及可賣空的數量,因系統風控要求逻複雜,不建議自行計算可交易數量。 +您可以調用交易類接口 `/v1/trade/estimate/buy_limit` 以獲取帳戶現金可買、融資可買及可賣空的數量,因系統風控要求逻複雜,不建議自行計算可交易數量。 ## Q8: 下單接口返回“用戶認證失敗”是什麼意思? -A: 通常表示對應交易業務的權限暫未開通,例如期權、美股賣空等。您可通過 App 委託掛單引導的權限開通流程,完成權限開通後,可繼續通過 OpenAPI 完成交易或其他操作。 +通常表示對應交易業務的權限暫未開通,例如期權、美股賣空等。您可通過 App 委託掛單引導的權限開通流程,完成權限開通後,可繼續通過 OpenAPI 完成交易或其他操作。 From f6800720887cdfb1da4c643c2cb6ebc1f10fc71c Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 8 Apr 2026 16:09:50 +0800 Subject: [PATCH 3/3] docs(sidebar): move Q&A after Socket Feed section Change Q&A position from 6 to 6.5 so it appears after Socket Feed (6) and before Changelog (7) in the sidebar. Co-Authored-By: Claude Sonnet 4.6 --- docs/en/docs/qa/_category_.json | 2 +- docs/zh-CN/docs/qa/_category_.json | 2 +- docs/zh-HK/docs/qa/_category_.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/docs/qa/_category_.json b/docs/en/docs/qa/_category_.json index d256a72e..5fbb875c 100644 --- a/docs/en/docs/qa/_category_.json +++ b/docs/en/docs/qa/_category_.json @@ -3,5 +3,5 @@ "collapsible": true, "collapsed": true, "link": null, - "position": 6 + "position": 6.5 } diff --git a/docs/zh-CN/docs/qa/_category_.json b/docs/zh-CN/docs/qa/_category_.json index 5cb5edf2..ca4cc317 100644 --- a/docs/zh-CN/docs/qa/_category_.json +++ b/docs/zh-CN/docs/qa/_category_.json @@ -3,5 +3,5 @@ "collapsible": true, "collapsed": true, "link": null, - "position": 6 + "position": 6.5 } diff --git a/docs/zh-HK/docs/qa/_category_.json b/docs/zh-HK/docs/qa/_category_.json index d256a72e..5fbb875c 100644 --- a/docs/zh-HK/docs/qa/_category_.json +++ b/docs/zh-HK/docs/qa/_category_.json @@ -3,5 +3,5 @@ "collapsible": true, "collapsed": true, "link": null, - "position": 6 + "position": 6.5 }