modifyOrder fails to move stop order, but returns success (s=200)

Moving a stop order with following code:

url=‘order/modifyorder’ = new WebSocket(url)${url}\n${id}\n${query || ''}\n${JSON.stringify(body)})

The reply is success:
mod ord res:{
“s”: 200,
“i”: 27,
“d”: {
“commandId”: 861227941

But the stop order in reality fails to move:

This results in the code unable to detect failure to move stop order, which can lead to serious issues. Any advice is appreciated!

Also I am thinking to query stop price to confirm move success, before letting the code proceed.
However documentation shows that /order/item and /order/dependents do not reply with any actual price data for the order.
I also realize there are different orderVersions for each order.
How can I quickly check the current stop price of an order?
Thank you

That’s normal, that just means the API accepted your request to modify the order. Notice that it returns a commandId. This is what you need to find out if your modification executed. Look up /executionReport/deps?masterId=<commandId> to find the result of the command to modify your order.

To check an order’s stop price, use /orderVersion/deps?masterid=<orderId>, that should give you the lastest orderVersion entity. One of its fields is stopPrice.

Edit: Don’t include the angle brackets, just the raw integer ID.

1 Like