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
2 changes: 1 addition & 1 deletion docs/en/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/qa/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"collapsible": true,
"collapsed": true,
"link": null,
"position": 6
"position": 6.5
}
37 changes: 29 additions & 8 deletions docs/en/docs/qa/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
23 changes: 7 additions & 16 deletions docs/en/docs/qa/quote.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<table>
<tr>
Expand Down Expand Up @@ -74,32 +74,25 @@ A: The security code uses the `ticker.region` format, `ticker` represents the co
</tr>
</table>

You can also use Longbridge App to find the symbol of security
<img src="https://pub.pbkrs.com/files/202206/7CSoiaDR4wGZPNCT/20220629-180013.jpeg" className="max-w-2xl" />

## 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
Longbridge users can choose the market cards they want to buy through the "Quote Store" in the Longbridge App.

## 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
- SG Market: 08:20:00 CST

## Q6: How to enable Overnight quote

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 {
Expand All @@ -115,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

Expand Down
21 changes: 13 additions & 8 deletions docs/en/docs/qa/trade.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion docs/en/docs/quote/pull/candlestick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br /><br />**Check rules:** <br />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)<br/><br/>Note: Overnight data requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card. US stocks only. |

### Protobuf

Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/quote/pull/history-candlestick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)<br/><br/>Note: Overnight data requires purchasing the "LV1 Real-time Quote (OpenAPI)" quote card. US stocks only. |

### Protobuf

Expand Down
Loading
Loading