mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
grid2: emit grid ready earlier
This commit is contained in:
parent
f039c97e63
commit
eb4e25c008
|
@ -884,6 +884,9 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
|||
|
||||
s.debugGridOrders(submitOrders, lastPrice)
|
||||
|
||||
// try to always emit grid ready
|
||||
defer s.EmitGridReady()
|
||||
|
||||
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
|
||||
if err2 != nil {
|
||||
return err
|
||||
|
@ -911,7 +914,6 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
|||
}
|
||||
|
||||
s.logger.Infof("ALL GRID ORDERS SUBMITTED")
|
||||
s.EmitGridReady()
|
||||
|
||||
s.updateOpenOrderPricesMetrics(createdOrders)
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user