开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

how to pause execution


 

In tws, we can pause the execution of an order.? Is there such a way to do in API?? Thanks.


 
Edited

There is no API function to do that. But you could just mimic what TWS does:

When you pause a working order, a cancel request is submitted to the exchange and the order is put into an inactive state but remains available on the Orders panel (Mosaic) or Quote Monitor (Classic) for you to resubmit at any time.


 

Hi, i am a little confused.? When you cancel an order, the final status is cancelled, not inactive.? Is that right?? Thanks.


 

That is correct. I was focusing on part of the IBKR TWS documentation where they say that "a cancel request is submitted to the exchange" when you pause an order. So you could mimic that if you keep the original order object, cancel the order (instead of pausing), and place it again at a later point in time. You would have to assign a new orderId, though.

But you are correct that this is not identical to what TWS can do and your "paused" order would have a final status of "Cancelled". And there are probably other major differences.

II did a quick test and it appears that TWS changes and reports the status for a paused order from "Submitted" to "PreSubmitted" and back to "Submitted" when you end the pause:

  • Limit order with unreachable limit price placed in TWS --> orderStatus:OrderID:-115:PermID:991541289:Submitted
  • Order "paused" in TWS --> orderStatus:OrderID:-115:PermID:991541289:PreSubmitted
  • Order "submitted" in TWS --> orderStatus:OrderID:-115:PermID:991541289:Submitted
  • Order "paused" in TWS --> orderStatus:OrderID:-115:PermID:991541289:PreSubmitted
  • Order "cancelled" in TWS --> orderStatus:OrderID:-115:PermID:991541289:Cancelled


 

Thanks for your help.


 

For the sake of perfectionism, I did another quick test and it looks like modifying an existing submitted order with ::Transmit = false does nothing. Which could reasonably, though not strictly, be expected from how the API documentation approaches the problem of order modification (it "generally" recommends changing only size, price and tif).


 

One issue to keep in mind when cancelling orders as opposed to manually "unsubmitting" them in TWS is how that could count toward IBKR order cancellation guidelines as I believe there?are fees for non-SMART order cancellation via API above a certain balance against executions ().


 

There is a small fee for certain order modifications and cancellations, but there are credits for executed orders, too. And the ratio is (depending on market, exchange, and instrument)? between 10:1 and 20:1, meaning you would need to make 10 to 20 times more modifications/cancellations than you have order executions before you actually have to pay.


On Fri, Feb 4, 2022 at 12:31 PM, ds-avatar wrote:
One issue to keep in mind when cancelling orders as opposed to manually "unsubmitting" them in TWS is how that could count toward IBKR order cancellation guidelines as I believe there?are fees for non-SMART order cancellation via API above a certain balance against executions ().