From 8f5f5dfeed0913c5c71476a1df447ef037bfcaf3 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 22 Nov 2023 17:34:26 +0800 Subject: [PATCH] bbgo: add executed quantity check when order status is OrderStatusPartiallyFilled --- pkg/bbgo/activeorderbook.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/bbgo/activeorderbook.go b/pkg/bbgo/activeorderbook.go index 5d8c0812d..2f80716d7 100644 --- a/pkg/bbgo/activeorderbook.go +++ b/pkg/bbgo/activeorderbook.go @@ -349,6 +349,12 @@ func isNewerUpdate(a, b types.Order) bool { switch b.Status { case types.OrderStatusNew: return true + case types.OrderStatusPartiallyFilled: + // unknown for equal + if a.ExecutedQuantity.Compare(b.ExecutedQuantity) > 0 { + return true + } + } case types.OrderStatusFilled: