grid2: fix complete grid order book condition

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

View File

@ -1526,12 +1526,7 @@ func (s *Strategy) replayOrderHistory(ctx context.Context, grid *Grid, orderBook
func isCompleteGridOrderBook(orderBook *bbgo.ActiveOrderBook, gridNum int64) bool {
tmpOrders := orderBook.Orders()
if len(tmpOrders) == int(gridNum) && types.OrdersAll(tmpOrders, types.IsActiveOrder) {
return true
}
return false
return len(tmpOrders) == int(gridNum)-1 && types.OrdersAll(tmpOrders, types.IsActiveOrder)
}
func findEarliestOrderID(orders []types.Order) (uint64, bool) {