From bc319a4378a7091839fea9b1676abe7077328de1 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Fri, 3 May 2024 21:47:59 +0200 Subject: [PATCH] add Market On Close order --- ib_async/order.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ib_async/order.py b/ib_async/order.py index d8d31cb9..d36a5125 100644 --- a/ib_async/order.py +++ b/ib_async/order.py @@ -228,6 +228,16 @@ def __init__( ) +class MarketOnCloseOrder(Order): + __slots__ = () + + def __init__(self, action: str, totalQuantity: float, **kwargs): + Order.__init__( + self, orderType="MOC", action=action, + totalQuantity=totalQuantity, **kwargs + ) + + @dataclass class OrderStatus: orderId: int = 0