Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order replace issue #32

Open
chavanrc opened this issue Jan 22, 2021 · 0 comments
Open

Order replace issue #32

chavanrc opened this issue Jan 22, 2021 · 0 comments

Comments

@chavanrc
Copy link

In order_book.h there is issue with order replace. Instead of quantity on market, original quantity is used for modification. It corrupts the book and causes issue in CloseOrder for price modify while deleting older order.

In order_book.h

case TypedCallback::cb_order_replace:
on_replace(cb.order,
cb.order->order_qty(),
cb.order->order_qty() + cb.delta,
cb.price);
if(order_listener_)
{
order_listener_->on_replace(cb.order,
cb.delta,
cb.price);
}
break;

Should be
case TypedCallback::cb_order_replace:
on_replace(cb.order,
cb.quantity_,
cb.quantity_ + cb.delta,
cb.price);
if(order_listener_)
{
order_listener_->on_replace(cb.order,
cb.delta,
cb.price);
}
break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant