Modify and Cancel Orders
Modify Order
Signature
pub async fn modify_order(&self, id: i64, order: OrderRequest) -> Result<Option<OrderIdResult>, TigerError>Description
Modify a submitted order. Only pending/partially-filled orders can be modified.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | i64 | Yes | Global order ID |
| order | OrderRequest | Yes | Fields to modify (unchanged fields left as None) |
Common modification fields: total_quantity, limit_price, aux_price, order_type, time_in_force, outside_rth, trailing_percent.
Response
| Field | Type | Description |
|---|---|---|
| id | i64 | Order ID |
Example
let mut modify = OrderRequest::default();
modify.limit_price = Some(196.0);
let result = trade.modify_order(31234567, modify).await?;
if let Some(r) = result {
println!("Modified order id={}", r.id);
}Response Example
{
"id": 31234567
}Cancel Order
Signature
pub async fn cancel_order(&self, id: i64) -> Result<Option<OrderIdResult>, TigerError>Description
Cancel a pending order.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | i64 | Yes | Global order ID |
Response
| Field | Type | Description |
|---|---|---|
| id | i64 | Cancelled order ID |
Example
let result = trade.cancel_order(31234567).await?;
if let Some(r) = result {
println!("Cancelled order id={}", r.id);
}Response Example
{
"id": 31234567
}Updated 1 day ago
Did this page help you?
