mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
grid2: fix complete grid order book condition
This commit is contained in:
parent
db119a2218
commit
72b6f73cb6
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user