From a75bc2e590debf6553bb85bf0b95972adb59a735 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 7 Mar 2023 21:42:53 +0800 Subject: [PATCH] grid2: add isCompleteGridOrderBook doc comment --- pkg/strategy/grid2/strategy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index 301e2659e..9c2c5fc0e 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -1524,6 +1524,7 @@ func (s *Strategy) replayOrderHistory(ctx context.Context, grid *Grid, orderBook return nil } +// isCompleteGridOrderBook checks if the number of open orders == gridNum - 1 and all orders are active order func isCompleteGridOrderBook(orderBook *bbgo.ActiveOrderBook, gridNum int64) bool { tmpOrders := orderBook.Orders() return len(tmpOrders) == int(gridNum)-1 && types.OrdersAll(tmpOrders, types.IsActiveOrder)