dyn4mik3 / OrderBook

Matching Engine for Limit Order Book
Other
361 stars 116 forks source link

Resolved issue #16 #17

Closed ChuaCheowHuan closed 4 years ago

ChuaCheowHuan commented 4 years ago

Resolved issue #16

Issue #16 is caused by not setting the prev_order & next_order variables of the current order to point to the new locations.

Added the following in line 90 to 92 in orderlist.py resolved the issue:

# Added to resolved issue #16
order.prev_order = self.tail_order
order.next_order = None

Output after running the minimal reproducible example.

***Bids***
10@1/0 - 1
20@1/1 - 2
30@1/2 - 3

***Asks***

***Trades***

***Bids***
20@1/1 - 2
30@1/2 - 3
100@1/0 - 4

***Asks***

***Trades***