grid2: split SubmitOrders calls

This commit is contained in:
c9s 2023-02-17 18:54:47 +08:00
parent 9d2c742496
commit 21cdb7afe8
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -894,9 +894,13 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
s.debugGridOrders(submitOrders, lastPrice)
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
if err2 != nil {
return err
var createdOrders []types.Order
for _, submitOrder := range submitOrders {
ret, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrder)
if err2 != nil {
return err2
}
createdOrders = append(createdOrders, ret...)
}
// try to always emit grid ready