Skip to content
Open
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
49 changes: 48 additions & 1 deletion docs/zh-CN/docs/trade/order/history_orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,32 @@ func main() {
"remark": "",
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1
"trigger_count": 1,
"attached_orders": [
{
"order_id": "706388312699592705",
"attached_type_display": 2,
"trigger_price": "10.500",
"quantity": "200",
"executed_qty": "0",
"status": "NewStatus",
"updated_at": "1651644898",
"withdrawn": false,
"gtd": "",
"time_in_force": "Day",
"counter_id": "",
"trigger_status": 0,
"executed_amount": "0",
"tag": 0,
"submitted_at": "1651644897",
"executed_price": "0.000",
"force_only_rth": "RTH_ONLY",
"reviewed": false,
"activate_order_type": "MO",
"activate_rth": "RTH_ONLY",
"submit_price": ""
}
]
}
]
}
Expand Down Expand Up @@ -339,3 +364,25 @@ func main() {
| ∟ limit_depth_level | int32 | true | 指定买卖档位 |
| ∟ monitor_price | string | true | 监控价格 |
| ∟ trigger_count | int32 | true | 触发次数 |
| ∟ attached_orders | object[] | false | 附加订单详情列表 |
| ∟∟ order_id | string | true | 附加订单 ID |
| ∟∟ attached_type_display | int32 | true | 附加订单类型。**可选值:** `1` - 止盈 `2` - 止损 |
| ∟∟ trigger_price | string | true | 触发价格 |
| ∟∟ quantity | string | true | 下单数量 |
| ∟∟ executed_qty | string | true | 成交数量 |
| ∟∟ status | string | true | 订单状态 |
| ∟∟ updated_at | string | true | 最近更新时间,格式为时间戳 (秒) |
| ∟∟ withdrawn | boolean | true | 是否已撤销 |
| ∟∟ gtd | string | true | GTD 到期日期,格式为 `YYYY-MM-DD` |
| ∟∟ time_in_force | string | true | 订单有效期类型<br/><br/> **可选值:**<br/> `Day` - 当日有效<br/> `GTC` - 撤单前有效<br/> `GTD` - 到期前有效 |
| ∟∟ counter_id | string | true | 对应单 ID |
| ∟∟ trigger_status | int32 | true | 附加单激活后的条件单触发状态。<br/>`0` - 未激活 <br/>`1` - 监控中 <br/>`2` - 已撤单 <br/>`4` - 已触发 |
| ∟∟ executed_amount | string | true | 成交金额 |
| ∟∟ tag | int32 | true | 订单标记 |
| ∟∟ submitted_at | string | true | 下单时间,格式为时间戳 (秒) |
| ∟∟ executed_price | string | true | 成交价格 |
| ∟∟ force_only_rth | string | true | 是否仅正常交易时段执行。 |
| ∟∟ reviewed | boolean | true | 是否已审核 |
| ∟∟ activate_order_type | string | true | 触发后提交的订单类型,例如 `LO`(限价单)或 `MO`(市价单) |
| ∟∟ activate_rth | string | true | 触发后提交订单是否允许盘前盘后。|
| ∟∟ submit_price | string | true | 委托价格 |
65 changes: 57 additions & 8 deletions docs/zh-CN/docs/trade/order/order_detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ longbridge order detail 693664675163312128

> Content-Type: application/json; charset=utf-8

| Name | Type | Required | Description |
| -------- | ------ | -------- | --------------------------------------------------------- |
| order_id | string | YES | 订单 ID,用于指定订单 ID 查询,例如:`701276261045858304` |
| Name | Type | Required | Description |
| ----------- | ------ | -------- | --------------------------------------------------------- |
| order_id | string | YES | 订单 ID,用于指定订单 ID 查询,例如:`701276261045858304` |
| is_attached | bool | NO | order_id 是否为附加单 |

### Request Example

Expand All @@ -50,6 +51,7 @@ ctx = TradeContext(config)

resp = ctx.order_detail(
order_id = "701276261045858304",
is_attached = False,
)
print(resp)
```
Expand All @@ -68,6 +70,7 @@ async def main() -> None:

resp = await ctx.order_detail(
order_id = "701276261045858304",
is_attached = False,
)
print(resp)

Expand Down Expand Up @@ -219,7 +222,6 @@ func main() {
</TabItem>
</Tabs>


## Response

### Response Headers
Expand Down Expand Up @@ -302,7 +304,32 @@ func main() {
],
"total_amount": "0",
"currency": "USD"
}
},
"attached_orders": [
{
"order_id": "706388312699592705",
"attached_type_display": 2,
"trigger_price": "10.500",
"quantity": "200",
"executed_qty": "0",
"status": "NewStatus",
"updated_at": "1651644898",
"withdrawn": false,
"gtd": "",
"time_in_force": "Day",
"counter_id": "",
"trigger_status": 0,
"executed_amount": "0",
"tag": 0,
"submitted_at": "1651644897",
"executed_price": "0.000",
"force_only_rth": "RTH_ONLY",
"reviewed": false,
"activate_order_type": "MO",
"activate_rth": "RTH_ONLY",
"submit_price": ""
}
]
}
}
```
Expand Down Expand Up @@ -380,6 +407,28 @@ func main() {
| ∟∟∟ name | string | true | 收费名称 |
| ∟∟∟ amount | string | true | 单项收费金额 |
| ∟∟∟ currency | string | true | 收费货币 |
| ∟∟∟ limit_depth_level | int32 | true | 指定买卖档位 |
| ∟∟∟ monitor_price | string | true | 监控价格 |
| ∟∟∟ trigger_count | int32 | true | 触发次数 |
| ∟ limit_depth_level | int32 | true | 指定买卖档位 |
| ∟ monitor_price | string | true | 监控价格 |
| ∟ trigger_count | int32 | true | 触发次数 |
| ∟ attached_orders | object[] | false | 附加订单详情列表 |
| ∟∟ order_id | string | true | 附加订单 ID |
| ∟∟ attached_type_display | int32 | true | 附加订单类型。**可选值:** `1` - 止盈 `2` - 止损 |
| ∟∟ trigger_price | string | true | 触发价格 |
| ∟∟ quantity | string | true | 下单数量 |
| ∟∟ executed_qty | string | true | 成交数量 |
| ∟∟ status | string | true | 订单状态 |
| ∟∟ updated_at | string | true | 最近更新时间,格式为时间戳 (秒) |
| ∟∟ withdrawn | boolean | true | 是否已撤销 |
| ∟∟ gtd | string | true | GTD 到期日期,格式为 `YYYY-MM-DD` |
| ∟∟ time_in_force | string | true | 订单有效期类型<br/><br/> **可选值:**<br/> `Day` - 当日有效<br/> `GTC` - 撤单前有效<br/> `GTD` - 到期前有效 |
| ∟∟ counter_id | string | true | 对应单 ID |
| ∟∟ trigger_status | int32 | true | 附加单激活后的条件单触发状态。<br/>`0` - 未激活 <br/>`1` - 监控中 <br/>`2` - 已撤单 <br/>`4` - 已触发 |
| ∟∟ executed_amount | string | true | 成交金额 |
| ∟∟ tag | int32 | true | 订单标记 |
| ∟∟ submitted_at | string | true | 下单时间,格式为时间戳 (秒) |
| ∟∟ executed_price | string | true | 成交价格 |
| ∟∟ force_only_rth | string | true | 是否仅正常交易时段执行。 |
| ∟∟ reviewed | boolean | true | 是否已审核 |
| ∟∟ activate_order_type | string | true | 触发后提交的订单类型,例如 `LO`(限价单)或 `MO`(市价单) |
| ∟∟ activate_rth | string | true | 触发后提交订单是否允许盘前盘后。 |
| ∟∟ submit_price | string | true | 委托价格 |
16 changes: 16 additions & 0 deletions docs/zh-CN/docs/trade/order/replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ 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` 订单必填 |
| 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 | 止盈触发价格 |
| attached_params.stop_loss_price | string | NO | 止损触发价格 |
| attached_params.time_in_force | string | NO | 附加单有效期类型<br/><br/>**可选值:**<br/>`Day` - 当日有效<br/> `GTC` - 撤单前有效<br/> `GTD` - 到期前有效(此时继承主单 expire_date) |
| attached_params.expire_time | int64 | NO | 到期时间(Unix 时间戳,单位秒) |
| attached_params.profit_taker_id | int64 | NO | 止盈单 ID,修改现有止盈单时填写 |
| attached_params.stop_loss_id | int64 | NO | 止损单 ID,修改现有止损单时填写 |
| attached_params.cancel_all_attached | bool | NO | 是否取消所有附加单 |
| attached_params.main_id | int64 | NO | 主单 ID |
| attached_params.quantity | string | NO | 附加单数量 |
| attached_params.market_price | string | NO | 市价 |
| attached_params.activate_order_type | string | NO | 触发后提交的订单类型,例如 `LO`(限价单)或 `MO`(市价单) |
| attached_params.profit_taker_submit_price | string | NO | 止盈限价委托价格,`activate_order_type` 为 `LO` 时必填 |
| attached_params.stop_loss_submit_price | string | NO | 止损限价委托价格,`activate_order_type` 为 `LO` 时必填 |
| attached_params.activate_rth | string | NO | 触发后提交的订单是否允许盘前盘后<br/><br/>**可选值:**<br/> `RTH_ONLY` - 不允许盘前盘后<br/> `ANY_TIME` - 允许盘前盘后<br/> `OVERNIGHT` - 夜盘 |


### Request Example
Expand Down
10 changes: 10 additions & 0 deletions docs/zh-CN/docs/trade/order/submit.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ longbridge order sell TSLA.US 100 --price 260.00
| limit_depth_level | int32 | NO | 指定买卖档位,取值范围为 -5 ~ 0 ~ 5,负数代表买盘档位(如 -1 表示买一),<br/>正数代表卖盘档位(如 1 表示卖一),为 0 时 limit_offset 参数生效<br/>`TSLPAMT` / `TSLPPCT` 订单有效 |
| monitor_price | string | NO | 监控价格,需要达到该价格才会开始监控,更新参考价<br/>`TSLPAMT` / `TSLPPCT` 订单有效 |
| trigger_count | int32 | NO | 触发次数,取值范围 0 ~ 3, 表示在 1 分钟内触发多次才会触发订单<br/>`LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` 订单有效 |
| 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 | 止盈触发价格 |
| attached_params.stop_loss_price | string | NO | 止损触发价格 |
| attached_params.time_in_force | string | NO | 附加单有效期类型<br/><br/>**可选值:**<br/>`Day` - 当日有效<br/> `GTC` - 撤单前有效<br/> `GTD` - 到期前有效(此时继承主单 expire_date) |
| attached_params.expire_time | int64 | NO | 到期时间(Unix 时间戳,单位秒) |
| attached_params.activate_order_type | string | NO | 触发后提交的订单类型,例如 `LO`(限价单)或 `MO`(市价单) |
| attached_params.profit_taker_submit_price | string | NO | 止盈限价委托价格,`activate_order_type` 为 `LO` 时必填 |
| attached_params.stop_loss_submit_price | string | NO | 止损限价委托价格,`activate_order_type` 为 `LO` 时必填 |
| attached_params.activate_rth | string | NO | 触发后提交的订单是否允许盘前盘后 <br/><br/>**可选值:**<br/> `RTH_ONLY` - 不允许盘前盘后<br/> `ANY_TIME` - 允许盘前盘后<br/> `OVERNIGHT` - 夜盘 |

## Examples

Expand Down
Loading
Loading