Skip to content

Commit 2503a99

Browse files
committed
Fix own book updates
1 parent b3e392f commit 2503a99

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

nautilus_trader/cache/cache.pyx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,12 +2006,7 @@ cdef class Cache(CacheFacade):
20062006
else:
20072007
self._index_orders_emulated.add(order.client_order_id)
20082008

2009-
if self._database is None:
2010-
return
2011-
2012-
# Update database
2013-
self._database.update_order(order)
2014-
2009+
# Update own book
20152010
if update_own_book and should_handle_own_book_order(order):
20162011
own_book = self._own_order_books.get(order.instrument_id)
20172012
if own_book is None:
@@ -2022,6 +2017,12 @@ cdef class Cache(CacheFacade):
20222017
else:
20232018
own_book.update(order.to_own_book_order())
20242019

2020+
if self._database is None:
2021+
return
2022+
2023+
# Update database
2024+
self._database.update_order(order)
2025+
20252026
cpdef void update_order_pending_cancel_local(self, Order order):
20262027
"""
20272028
Update the given `order` as pending cancel locally.

0 commit comments

Comments
 (0)