Replace Order
replace_orderModify an open order's quantity, price, trigger price, or trailing parameters. Preview the change in a dry run, then execute only after user confirmation.
Instructions
Modify an open order's quantity, price, trigger_price, or trailing params. Returns "order replaced" on success. Only open/pending orders can be modified. TWO-STEP CONFIRMATION IS MANDATORY: this tool is a DRY RUN unless you pass the confirmation_code its own dry run returned. Call it first without execute, show the returned preview to the user, and only call it again with execute="" after the user has explicitly confirmed that exact order. The code is derived from the order itself, so it applies only to that exact order. Never quote it back on your own initiative, and never in the same turn the user first asks. The dry run echoes the current order alongside the requested change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price | No | New limit price (for limit-style orders) | |
| execute | No | The `confirmation_code` from this order's dry run. WITHOUT IT NOTHING IS SENT. Omitted (the default) makes this a DRY RUN: the request is validated and echoed back with a three-digit `confirmation_code`, and nothing reaches the exchange. Required protocol: call once without `execute`, show the returned preview to the user, and call again quoting the code only after the user has explicitly confirmed that exact order. The code is single use, expires in 10 minutes, and applies only to this exact order — change any field and it stops working. Never quote it back on your own initiative, and never in the same turn the user first asks. | |
| order_id | Yes | Order ID to replace (returned by submit_order or listed in today_orders / history_orders) | |
| quantity | Yes | New order quantity (number of shares) | |
| limit_offset | No | New limit offset from the trailing stop price (for TSLPAMT / TSLPPCT) | |
| trigger_price | No | New trigger (activation) price (for LIT / MIT / trailing-stop orders) | |
| trailing_amount | No | New trailing amount as absolute price distance (for TSLPAMT) | |
| trailing_percent | No | New trailing percent as decimal e.g. 0.05 = 5% (for TSLPPCT) |