Skip to content

Commit 6c0945b

Browse files
committed
add order process
1 parent c0cd35f commit 6c0945b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/algosim.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ def process_line(order_book, line):
4747
algo_orders = myalgo.process_order(line,
4848
trade, order)
4949
for line in algo_orders:
50-
(trade, order) = order_book.process_order(line,
51-
False,
52-
False)
53-
myalgo.trade_stats(trade)
50+
if line['type'] == 'cancel':
51+
order_book.cancel_order(line['side'],
52+
line['order_id'])
53+
else:
54+
(trade, order) = order_book.process_order(line,
55+
False,
56+
False)
57+
myalgo.trade_stats(trade)
5458
if len(algo_orders) > 0:
5559
print("\n")
5660
print("After algo")

0 commit comments

Comments
 (0)