Open QuinDennis opened 6 years ago
Theres a possibility I'm wrong havent tested yet but I think IB automatically strips Market Orders and Stop Orders of all after hours commands and only executes them during regular trading hours. Whereas Limit and Stop Limit Orders do not get stripped and work correctly.
Something like @mjheller said. IB will also send pointless 2019
errors if you set outsideRth: true
for contracts that don't have the "outside regular trading hours" concept (e.g. ES):
Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.
If I set outsideRth
for STP and TRAIL orders on contracts like RTY
, I do see the warning mark:
I just tested outsideRth and it is working correctly, as @meteorpublish illustrated. I am using futures though. I am not 100% sure about the execution, but my MKT order got executed immediately from TWS, even if outside RTH, but for LMT, STP, TRAIL, ... you have to add the outsideRth flag. I presume the API behavior should be the same. The flag is present in TWS, if the order was submitted via API. So as for the original question by @QuinDennis, the flag is working correctly.
Verified STP LMT, both STP and subsequent LMT triggered outsideRth at 7:00 CT on GC contract, while trading hours start 8:30 CT.
created an order: o = ib.order.trailingStop, then o.outsideRth=true, but the order 'Allow this order to be triggered outside of regular trading hours' is not checked.