-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
There's a bug in the on_replace_order function.
When a change is made to the same price, the size of the price is added instead of being updated.
Because the dict side_dicts is not update between thoses 2 lines
old_price_level_size = side_dicts[old_price] - old_size
new_price_level_size = (side_dicts[new_price] if new_price in side_dicts else 0) + new_size
Fix :
old_price_level_size = side_dicts[old_price] - old_size
new_price_level_size = (side_dicts[new_price] if new_price in side_dicts else 0) + new_size
on_depth(mbp_book, is_order_bid, old_price, old_price_level_size)
on_depth(mbp_book, is_order_bid, new_price, new_price_level_size)
to
old_price_level_size = side_dicts[old_price] - old_size
on_depth(mbp_book, is_order_bid, old_price, old_price_level_size)
new_price_level_size = (side_dicts[new_price] if new_price in side_dicts else 0) + new_size
on_depth(mbp_book, is_order_bid, new_price, new_price_level_size)
Metadata
Metadata
Assignees
Labels
No labels