mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 07:15: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)
|
s.debugGridOrders(submitOrders, lastPrice)
|
||||||
|
|
||||||
|
// try to always emit grid ready
|
||||||
|
defer s.EmitGridReady()
|
||||||
|
|
||||||
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
|
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -911,7 +914,6 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.logger.Infof("ALL GRID ORDERS SUBMITTED")
|
s.logger.Infof("ALL GRID ORDERS SUBMITTED")
|
||||||
s.EmitGridReady()
|
|
||||||
|
|
||||||
s.updateOpenOrderPricesMetrics(createdOrders)
|
s.updateOpenOrderPricesMetrics(createdOrders)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user