bbgo,grid2: add place order error log

This commit is contained in:
c9s 2022-12-15 18:54:02 +08:00
parent 051aa19989
commit fcd7a20b78
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 5 additions and 1 deletions

View File

@ -218,6 +218,10 @@ func (e *GeneralOrderExecutor) SubmitOrders(ctx context.Context, submitOrders ..
}
createdOrders, errIdx, err := BatchPlaceOrder(ctx, e.session.Exchange, formattedOrders...)
if err != nil {
log.WithError(err).Errorf("place order error, will retry orders: %v", errIdx)
}
if len(errIdx) > 0 {
createdOrders2, err2 := BatchRetryPlaceOrder(ctx, e.session.Exchange, errIdx, formattedOrders...)
if err2 != nil {

View File

@ -826,11 +826,11 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
return err
}
s.logger.Infof("grid orders submitted:")
for _, order := range createdOrders {
s.logger.Info(order.String())
}
s.logger.Infof("ALL GRID ORDERS SUBMITTED")
return nil
}