Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions ib_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,9 +842,16 @@ def reqHistoricalData(
self.send(*fields)

def exerciseOptions(
self, reqId, contract, exerciseAction, exerciseQuantity, account, override
self,
reqId,
contract,
exerciseAction,
exerciseQuantity,
account,
override,
manualOrderTime,
):
self.send(
fields = [
21,
2,
reqId,
Expand All @@ -863,7 +870,10 @@ def exerciseOptions(
exerciseQuantity,
account,
override,
)
]
if self.serverVersion() >= 180:
fields += [manualOrderTime]
self.send(*fields)

def reqScannerSubscription(
self,
Expand Down
11 changes: 9 additions & 2 deletions ib_async/ib.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
LimitOrder,
Order,
OrderState,
OrderStateNumeric,
OrderStatus,
StopOrder,
Trade,
Expand Down Expand Up @@ -1784,6 +1783,7 @@ def exerciseOptions(
exerciseQuantity: int,
account: str,
override: int,
manualOrderTime: str,
):
"""
Exercise an options contract.
Expand All @@ -1800,10 +1800,17 @@ def exerciseOptions(
override:
* 0 = no override
* 1 = override the system's natural action
manualOrderTime: Manual Order Time
"""
reqId = self.client.getReqId()
self.client.exerciseOptions(
reqId, contract, exerciseAction, exerciseQuantity, account, override
reqId,
contract,
exerciseAction,
exerciseQuantity,
account,
override,
manualOrderTime,
)

def reqNewsProviders(self) -> list[NewsProvider]:
Expand Down