Skip to content

for reqExecutions execFilter cannot be empty #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions ib_async/ib.py
Original file line number Diff line number Diff line change
@@ -947,7 +947,7 @@ def reqCompletedOrders(self, apiOnly: bool) -> List[Trade]:
"""
return self._run(self.reqCompletedOrdersAsync(apiOnly))

def reqExecutions(self, execFilter: Optional[ExecutionFilter] = None) -> List[Fill]:
def reqExecutions(self, execFilter: ExecutionFilter) -> List[Fill]:
"""
It is recommended to use :meth:`.fills` or
:meth:`.executions` instead.
@@ -2063,7 +2063,9 @@ async def connectAsync(
# the request for executions must come after all orders are in
if fetchFields & StartupFetch.EXECUTIONS:
try:
await asyncio.wait_for(self.reqExecutionsAsync(), timeout)
execFilter = ExecutionFilter()
execFilter.clientId = clientId
await asyncio.wait_for(self.reqExecutionsAsync(execFilter), timeout)
except asyncio.TimeoutError:
msg = "executions request timed out"
errors.append(msg)
@@ -2207,7 +2209,9 @@ def reqCompletedOrdersAsync(self, apiOnly: bool) -> Awaitable[List[Trade]]:
def reqExecutionsAsync(
self, execFilter: Optional[ExecutionFilter] = None
) -> Awaitable[List[Fill]]:
execFilter = execFilter or ExecutionFilter()
if execFilter is None:
execFilter = ExecutionFilter()
execFilter.clientId = self.client.clientId
reqId = self.client.getReqId()
future = self.wrapper.startReq(reqId)
self.client.reqExecutions(reqId, execFilter)