mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 07:15:15 +00:00
Fix: binance's cancel update is sent through New status with 0 quantity
This commit is contained in:
parent
610c33b819
commit
ba091dccf6
|
@ -47,9 +47,17 @@ func (b *LocalActiveOrderBook) orderUpdateHandler(order types.Order) {
|
||||||
b.EmitFilled(order)
|
b.EmitFilled(order)
|
||||||
}
|
}
|
||||||
|
|
||||||
case types.OrderStatusPartiallyFilled, types.OrderStatusNew:
|
case types.OrderStatusPartiallyFilled:
|
||||||
b.Update(order)
|
b.Update(order)
|
||||||
|
|
||||||
|
case types.OrderStatusNew:
|
||||||
|
if order.Quantity == 0 {
|
||||||
|
log.Debugf("[LocalActiveOrderBook] order status %s, removing %d...", order.Status, order.OrderID)
|
||||||
|
b.Remove(order)
|
||||||
|
} else {
|
||||||
|
b.Update(order)
|
||||||
|
}
|
||||||
|
|
||||||
case types.OrderStatusCanceled, types.OrderStatusRejected:
|
case types.OrderStatusCanceled, types.OrderStatusRejected:
|
||||||
log.Debugf("[LocalActiveOrderBook] order status %s, removing %d...", order.Status, order.OrderID)
|
log.Debugf("[LocalActiveOrderBook] order status %s, removing %d...", order.Status, order.OrderID)
|
||||||
b.Remove(order)
|
b.Remove(order)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user