开云体育

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

how to unset goodAfterTime ?


 

?
I am able to set the goodAfterTime field as expected for a standing order, e.g. to "20250113 15:59:00 US/Eastern", and it seems to work as expected. ?
?
However, I would also like to be able to reset the field to "", so as to remove the goodAfterTime constraint, allowing the order to fill immediately. ?I can't get this to work. ?I am able to reset the field to "", and to re-place the order, but the goodAfterTime field on the standing order is not reset. ?(See code below.)
?
(The order stays in "presubmit" status, and in the TWS GUI, if I examine the fields via the order-modification panel, it still shows the original goodAfterTime value.)
?
Checking the "audit trail" of messages through the TWS GUI, I see that the goodAfterTime field seems to transmit as a numeric field number 168.
?
As far as I can tell, even after I reset goodAfterTime, that field is not being transmitted with the new value of "".
?
I've been banging my head against this for several hours now. ? What am I doing wrong?
?
help!? ?thank you,
?
-Neal
?
Code to set the field:
order.goodAfterTime = "20250113 15:59:00 US/Eastern"
order.tif = "GTC"
ib.placeOrder(contract, order)
Code to unset it:
    order.goodAfterTime = ""
order.tif = "GTC"
ib.placeOrder(self.contract, self.order)


 

?
It seems this is not possible with TWS API. ?More generally, the only way to "pause" and "resume" a standing limit order seems to be to raise and lower the limit price. ?See the following topic at the TWS group for more info: /g/twsapi/topic/conditional_order_conditioned/110515714
?
-Neal