Skip to content

Commit

Permalink
fixed IBKR bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaron committed Feb 27, 2024
1 parent 4f8c8dc commit 08726f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roboquant/brokers/ibkrbroker.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def orderStatus(
):
logger.debug("order status orderId=%s status=%s fill=%s", orderId, status, filled)
orderId = str(orderId)
if id in self.orders:
if orderId in self.orders:
order = self.orders[orderId]
order.fill = filled
match status:
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/test_ibkrbroker.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ def test_ibkrbroker(self):
time.sleep(5)
account = broker.sync()
self.assertEqual(len(account.orders), 1)
self.assertTrue(account.orders[0].closed)
self.assertEqual(OrderStatus.CANCELLED, account.orders[0].status)

order = account.orders[0]
self.assertTrue(order.closed)
self.assertEqual(OrderStatus.CANCELLED, order.status)
print()
print(account)


Expand Down

0 comments on commit 08726f8

Please sign in to comment.