bbgo: add executed quantity check when order status is OrderStatusPartiallyFilled

This commit is contained in:
c9s 2023-11-22 17:34:26 +08:00
parent 75b8be5e17
commit 8f5f5dfeed
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -349,6 +349,12 @@ func isNewerUpdate(a, b types.Order) bool {
switch b.Status { switch b.Status {
case types.OrderStatusNew: case types.OrderStatusNew:
return true return true
case types.OrderStatusPartiallyFilled:
// unknown for equal
if a.ExecutedQuantity.Compare(b.ExecutedQuantity) > 0 {
return true
}
} }
case types.OrderStatusFilled: case types.OrderStatusFilled: