REQ: Add TimeInForce.AT_THE_CLOSE support to IB adapter #1660
Replies: 3 comments 4 replies
-
Hi @fredmonroe I think that this is a common case for the Nautilus domain model where there are often external order types we don't represent within the framework, the set of order types we do include are fairly core/generic. Potentially all that would be required is to translate Nautilus I'm not so familiar with IB though, so maybe @rsmb7z or @benjaminsingleton would like to comment here? |
Beta Was this translation helpful? Give feedback.
-
Hi @fredmonroe,
Edit: My bad, confused with something else. |
Beta Was this translation helpful? Give feedback.
-
Hi @fredmonroe |
Beta Was this translation helpful? Give feedback.
-
ib doesn't neatly fit the nautilus model for MOC orders - they don't use TIF to indicate a maket on close order - its actually a different order type...
so ideally it would look like this inside the adapter (pseudo code):
if (order.type == 'market') && (order.tif == 'AT_THE_CLOSE'):
order.type = "MOC"
details here:
https://www.interactivebrokers.com/en/trading/orders/moc.php
I'd be open to trying to do this as a PR if its hard for you guys to implement or low priority
i'm new to doing a PR but not to programming
its a little tricky because the current model assumes all 1 <--> 1 mappings for the TIF and order_type fields and this is a weird special case:
nautilus_trader/nautilus_trader/adapters/interactive_brokers/execution.py
Line 305 in 5c1c312
Beta Was this translation helpful? Give feedback.
All reactions