Unable to cancel stop order if it has not been triggered
Gordon-TheTurtle opened this issue · comments
Gordon-The-Turtle commented
OrderBook::cancel(const OrderPtr& order) function does not check for the order in stop orders during cancellation.
So if you place a cancel order for stop order that has not been triggered yet you will not be able to cancel it and a cancel reject callback is generated.
Correct behaviour:
- Try to cancel the order in normal orders.
- If order exists, generate cancel callback, else check for the order in stop orders.
- If order exists, generate cancel callback else cancel reject callback.
I can submit a pull request if required.
Eric commented
I have confirmed a similar bug and may have a fix to merge soon after some additional scrutiny. Feel free to submit a PR and we can compare with other proposed fixes.
Gordon-The-Turtle commented
Great, I will start working on it.
Gordon-The-Turtle commented
Eric commented
merged