Cancel Replace
The CANCELREPLACE command is effectively a CANCEL order + PLACE order command combination and accepts similar parameters. The caveat is that the PLACE command will only proceed if and only if the order exists and was successfully canceled.
The order_id field is required to identify the order in question to cancel. If it is not found or not linked to an active order, an error message will be returned.
Example Payload
The following alert message will cancel the order with ID "abc123" and execute the remaining fields as a PLACE order command:
key=your-secret-key;
command=cancelreplace;
account=sim101;
instrument=ES 09-26;
action=buy;
qty=1;
order_type=market;
tif=day;
order_id=abc123;
CANCELREPLACE works with destination=tradovate;. The referenced order is canceled first, and the replacement is only placed when that cancel succeeds — if the original already filled, the command stops with an error instead of doubling your exposure. order_id accepts either the numeric Tradovate order id or the order_id you set on the original place alert.