grid2: add isCompleteGridOrderBook doc comment

This commit is contained in:
c9s 2023-03-07 21:42:53 +08:00
parent 72b6f73cb6
commit a75bc2e590
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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)