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
4 changes: 4 additions & 0 deletions docs/en/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ sidebar_icon: newspaper
description: 'Release notes for Longbridge OpenAPI, CLI, MCP and SDKs, newest first: new commands, API endpoints, MCP tools and other changes.'
---

## 2026-10-13

- **[Time-condition orders](/docs/trade/order/submit#time-condition-orders)** — pass `delayed_until` when submitting a regular or multi-leg order to have it held and sent automatically at a set time (up to 90 days ahead); change or clear the time with Replace Order, and read it back from the order query APIs

## 2026-09-28

### CLI v0.29.0
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/trade/definition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ description: 'Field and enum definitions used by Longbridge trading APIs, includ
| ReplacedNotReported | NotReported (Replaced Order) |
| ProtectedNotReported | NotReported (Protected Order) |
| VarietiesNotReported | NotReported (Conditional Order) |
| DelayedNotReported | Monitoring (Time-Conditional Order)|
| FilledStatus | Filled |
| WaitToNew | Wait To New |
| NewStatus | New |
Expand Down
2 changes: 2 additions & 0 deletions docs/en/docs/trade/order/history_orders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func main() {
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1,
"delayed_until": "0",
"attached_orders": [
{
"order_id": "706388312699592705",
Expand Down Expand Up @@ -391,6 +392,7 @@ func main() {
| ∟ limit_depth_level | int32 | true | Specifies the bid/ask depth level |
| ∟ monitor_price | string | true | Monitoring price |
| ∟ trigger_count | int32 | true | Number of triggers |
| ∟ delayed_until | string | true | Time-condition submit time, formatted as a timestamp (second).<br/><br/>`0` when the order is not a time-condition order |
| ∟ attached_orders | object[] | false | List of attached order details |
| ∟∟ order_id | string | true | Attached order ID |
| ∟∟ attached_type_display | int32 | true | Attached order type.<br/><br/> **Enum Value:**<br/> `1` - Take Profit<br/> `2` - Stop Loss |
Expand Down
2 changes: 2 additions & 0 deletions docs/en/docs/trade/order/order_detail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func main() {
"outside_rth": "ANY_TIME",
"currency": "USD",
"remark": "1680863603.927165",
"delayed_until": "0",
"free_status": "None",
"free_amount": "",
"free_currency": "",
Expand Down Expand Up @@ -409,6 +410,7 @@ Order Information
| currency | string | true | Currency |
| outside_rth | string | true | Enable or disable outside regular trading hours<br/> Default is `UnknownOutsideRth` when the order is not a US stock<br/><br/> **Enum Value:**<br/> `RTH_ONLY` - Regular trading hour only<br/> `ANY_TIME` - Any time<br/> `OVERNIGHT` - Overnight" |
| remark | string | true | Remark |
| delayed_until | string | true | Time-condition submit time, formatted as a timestamp (second).<br/><br/>`0` when the order is not a time-condition order |
| free_status | string | true | Commission-free Status, default value is None<br/><br/> **Enum Value:**<br/> `None` - None<br/> `Calculated` - Commission-free amount to be calculated<br/> `Pending` - Pending commission-free<br/> `Ready` - Commission-free applied |
| free_amount | string | true | Commission-free amount, default value is empty string. |
| free_currency | string | true | Commission-free currency, default value is empty string. |
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/trade/order/replace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ longbridge order replace 693664675163312128 --qty 200 --price 255.00
| limit_depth_level | int32 | NO | Specifies the bid/ask depth level. `TSLPAMT` / `TSLPPCT` Order Required |
| monitor_price | string | NO | Monitoring price. `TSLPAMT` / `TSLPPCT` Order Required |
| trigger_count | int32 | NO | Number of triggers. `LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` Order Required |
| delayed_until | int64 | NO | Time-condition submit time, Unix timestamp in seconds, example: `1767225600`<br/><br/>`0` or omitted - keep the current time condition<br/>`1` - clear the time condition<br/>Other values - set a new time, which must be later than the current time and no more than 90 days ahead |
| attached_params | object | NO | Attached order parameters (take-profit / stop-loss) |
| attached_params.attached_order_type | string | NO | Attached order type<br/><br/>**Enum Value:**<br/>`PROFIT_TAKER` - Take Profit<br/>`STOP_LOSS` - Stop Loss<br/>`BRACKET` - Bracket Order |
| attached_params.profit_taker_price | string | NO | Take-profit trigger price |
Expand Down
14 changes: 14 additions & 0 deletions docs/en/docs/trade/order/submit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ longbridge order sell TSLA.US 100 --price 260.00
| monitor_price | string | NO | Monitoring price. <br/>Monitoring starts only after reaching this price, updating the reference price.<br/>Valid for `TSLPAMT` / `TSLPPCT` orders. |
| trigger_count | int32 | NO | Number of triggers. Value range is 0 ~ 3.<br/>Specifies that within 1 minute, the order will only be placed after being triggered multiple times.<br/>Valid for `LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` orders. |
| client_request_id | string | NO | Idempotent request ID for preventing duplicate order submissions. The server caches this request ID for 10 minutes. If a request with the same ID is received within this period, it returns the same response without creating a duplicate order. Must be a unique identifier (e.g., UUID). |
| delayed_until | int64 | NO | Time-condition order: the order is held (status `DelayedNotReported`) and only submitted at this time. Unix timestamp in seconds, example: `1767225600`<br/><br/>Must be later than the current time and no more than 90 days ahead. Omit or pass `0` for a regular order. See [Time-Condition Orders](#time-condition-orders) for supported order types |
| attached_params | object | NO | Attached order parameters (take-profit / stop-loss) |
| attached_params.attached_order_type | string | NO | Attached order type<br/><br/>**Enum Value:**<br/>`PROFIT_TAKER` - Take Profit<br/>`STOP_LOSS` - Stop Loss<br/>`BRACKET` - Bracket Order |
| attached_params.profit_taker_price | string | NO | Take-profit trigger price |
Expand Down Expand Up @@ -89,6 +90,19 @@ If you do not provide `client_request_id` (or pass an empty value), the request

It is strongly recommended to always provide a unique `client_request_id` for critical order submissions to prevent unintended duplicates.

### Time-Condition Orders

Pass `delayed_until` (Unix timestamp in seconds) to create a time-condition order. The order is not sent to the exchange right away: it stays in `DelayedNotReported` status and is submitted automatically when the time arrives. The time must be later than now and no more than 90 days ahead.

Supported markets and order types:

- HK stocks / warrants: `LO` / `ELO` / `MO` / `LIT` / `MIT`
- US stocks / warrants / options: `LO` / `MO` / `LIT` / `MIT`
- SG stocks: `LO` / `MO` / `LIT` / `MIT`
- Crypto: `LO` / `MO`

Use [Replace Order](./replace) to change the time (`delayed_until` set to a new time) or turn it into a regular order (`delayed_until` set to `1`). Order queries return the time in the `delayed_until` field.

### Request Example

<Tabs groupId="request-example">
Expand Down
1 change: 1 addition & 0 deletions docs/en/docs/trade/order/submit_multileg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This API is used to submit a multi-leg option combination order (such as vertica
| ∟ ratio_quantity | string | YES | Leg ratio quantity, example: `1` |
| remark | string | NO | Remark (Maximum 255 characters) |
| client_request_id | string | NO | Client request ID, used for idempotency (Maximum 64 characters) |
| delayed_until | int64 | NO | Time-condition order: the order is held (status `DelayedNotReported`) and only submitted at this time. Unix timestamp in seconds, example: `1767225600`<br/><br/>Must be later than the current time and no more than 90 days ahead. Only `LO` / `MO` are supported. Omit or pass `0` for a regular order |

### Request Example

Expand Down
2 changes: 2 additions & 0 deletions docs/en/docs/trade/order/today_orders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ func main() {
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1,
"delayed_until": "0",
"attached_orders": [
{
"order_id": "706388312699592705",
Expand Down Expand Up @@ -383,6 +384,7 @@ func main() {
| ∟ limit_depth_level | int32 | true | Specifies the bid/ask depth level |
| ∟ monitor_price | string | true | Monitoring price |
| ∟ trigger_count | int32 | true | Number of triggers |
| ∟ delayed_until | string | true | Time-condition submit time, formatted as a timestamp (second).<br/><br/>`0` when the order is not a time-condition order |
| ∟ attached_orders | object[] | false | List of attached order details |
| ∟∟ order_id | string | true | Attached order ID |
| ∟∟ attached_type_display | int32 | true | Attached order type.<br/><br/> **Enum Value:**<br/> `1` - Take Profit<br/> `2` - Stop Loss |
Expand Down
4 changes: 4 additions & 0 deletions docs/zh-CN/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ sidebar_icon: newspaper
description: 'Longbridge OpenAPI、CLI、MCP 与 SDK 的更新日志,按时间倒序列出新增命令、接口、MCP 工具及其他变更。'
---

## 2026-10-13

- **[时间条件单](/zh-CN/docs/trade/order/submit#时间条件单)** — 下单与多腿下单支持传入 `delayed_until`,订单先进入监控,到达指定时间(最长 90 天)后自动提交;可通过改单修改或清除提交时间,订单查询接口同步返回该字段

## 2026-09-28

### CLI v0.29.0
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/docs/trade/definition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ description: 'Longbridge 交易接口用到的字段与枚举定义,包括订
| ReplacedNotReported | 待提交 (改单成功) |
| ProtectedNotReported | 待提交 (保价订单) |
| VarietiesNotReported | 待提交 (条件单) |
| DelayedNotReported | 监控中 (时间条件单)|
| FilledStatus | 已成交 |
| WaitToNew | 已提待报 |
| NewStatus | 已委托 |
Expand Down
2 changes: 2 additions & 0 deletions docs/zh-CN/docs/trade/order/history_orders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ func main() {
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1,
"delayed_until": "0",
"attached_orders": [
{
"order_id": "706388312699592705",
Expand Down Expand Up @@ -390,6 +391,7 @@ func main() {
| ∟ limit_depth_level | int32 | true | 指定买卖档位 |
| ∟ monitor_price | string | true | 监控价格 |
| ∟ trigger_count | int32 | true | 触发次数 |
| ∟ delayed_until | string | true | 时间条件单的提交时间,格式为时间戳 (秒)<br/><br/>非时间条件单时为 `0` |
| ∟ attached_orders | object[] | false | 附加订单详情列表 |
| ∟∟ order_id | string | true | 附加订单 ID |
| ∟∟ attached_type_display | int32 | true | 附加订单类型。**可选值:** `1` - 止盈 `2` - 止损 |
Expand Down
2 changes: 2 additions & 0 deletions docs/zh-CN/docs/trade/order/order_detail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func main() {
"outside_rth": "ANY_TIME",
"currency": "USD",
"remark": "1680863603.927165",
"delayed_until": "0",
"free_status": "None",
"free_amount": "",
"free_currency": "",
Expand Down Expand Up @@ -408,6 +409,7 @@ func main() {
| currency | string | true | 结算货币 |
| outside_rth | string | true | 是否允许盘前盘后<br/> 当订单不是美股时,默认为 UnknownOutsideRth<br/><br/> **可选值:**<br/> `RTH_ONLY` - 不允许盘前盘后<br/> `ANY_TIME` - 允许盘前盘后<br/> `OVERNIGHT` - 夜盘" |
| remark | string | true | 备注 |
| delayed_until | string | true | 时间条件单的提交时间,格式为时间戳 (秒)<br/><br/>非时间条件单时为 `0` |
| free_status | string | true | 免佣状态,默认为 None<br/><br/> **可选值:**<br/> `None` - 无<br/> `Calculated` - 免佣额待计算<br/> `Pending` - 待免佣<br/> `Ready` - 已免佣 |
| free_amount | string | true | 免佣金额,默认为空字符串 |
| free_currency | string | true | 免佣货币,默认为空字符串 |
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/docs/trade/order/replace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ longbridge order replace 693664675163312128 --qty 200 --price 255.00
| limit_depth_level | int32 | NO | 指定买卖档位,`TSLPAMT` / `TSLPPCT` 订单必填 |
| monitor_price | string| NO | 监控价格,`TSLPAMT` / `TSLPPCT` 订单必填 |
| trigger_count | int32 | NO | 触发次数,`LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` 订单必填 |
| delayed_until | int64 | NO | 时间条件单的提交时间,Unix 时间戳(秒),例如:`1767225600`<br/><br/>`0` 或不传 - 不修改时间条件<br/>`1` - 清除时间条件<br/>其他值 - 设置新的提交时间,必须晚于当前时间且不超过 90 天 |
| attached_params | object | NO | 附加单参数(止盈止损) |
| attached_params.attached_order_type | string | NO | 附加单订单类型<br/><br/>**可选值:**<br/>`PROFIT_TAKER` - 止盈<br/>`STOP_LOSS` - 止损<br/>`BRACKET` - 括号单 |
| attached_params.profit_taker_price | string | NO | 止盈触发价格 |
Expand Down
14 changes: 14 additions & 0 deletions docs/zh-CN/docs/trade/order/submit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ longbridge order sell TSLA.US 100 --price 260.00
| monitor_price | string | NO | 监控价格,需要达到该价格才会开始监控,更新参考价<br/>`TSLPAMT` / `TSLPPCT` 订单有效 |
| trigger_count | int32 | NO | 触发次数,取值范围 0 ~ 3, 表示在 1 分钟内触发多次才会触发订单<br/>`LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` 订单有效 |
| client_request_id | string | NO | 幂等性请求 ID,用于防止重复下单。服务器会缓存该请求 ID 10 分钟。在此期间内如果收到相同 ID 的请求,将返回原始响应而不创建重复订单。必须是唯一标识符(如 UUID)。 |
| delayed_until | int64 | NO | 时间条件单:订单先进入监控(状态为 `DelayedNotReported`),到达该时间后才提交。Unix 时间戳(秒),例如:`1767225600`<br/><br/>必须晚于当前时间且不超过 90 天。不传或传 `0` 表示普通订单。支持的订单类型见[时间条件单](#时间条件单) |
| attached_params | object | NO | 附加单参数(止盈止损) |
| attached_params.attached_order_type | string | NO | 附加单订单类型<br/><br/>**可选值:**<br/>`PROFIT_TAKER` - 止盈<br/>`STOP_LOSS` - 止损<br/>`BRACKET` - 括号单 |
| attached_params.profit_taker_price | string | NO | 止盈触发价格 |
Expand Down Expand Up @@ -85,6 +86,19 @@ longbridge order sell TSLA.US 100 --price 260.00

强烈建议在关键下单操作中始终提供唯一的 `client_request_id`,以防止意外的重复订单。

## 时间条件单

传入 `delayed_until`(Unix 时间戳,秒)即可提交时间条件单。订单不会立即报送交易所,而是以 `DelayedNotReported` 状态等待,到达指定时间后自动提交。该时间必须晚于当前时间且不超过 90 天。

支持的市场与订单类型:

- 港股正股 / 窝轮:`LO` / `ELO` / `MO` / `LIT` / `MIT`
- 美股正股 / 窝轮 / 期权:`LO` / `MO` / `LIT` / `MIT`
- 新加坡股票:`LO` / `MO` / `LIT` / `MIT`
- 加密货币:`LO` / `MO`

可通过[改单](./replace)修改提交时间(`delayed_until` 传新的时间),或转为普通订单(`delayed_until` 传 `1`)。订单查询接口通过 `delayed_until` 字段返回该时间。

## Examples

为了方便理解,我们下面以 Python 作为示例,介绍如何实现一些场景的下单操作。
Expand Down
Loading
Loading