mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
move emit ready and update metrics
This commit is contained in:
parent
fba73f11ea
commit
cc5ebd5b2c
|
@ -58,6 +58,16 @@ func (s *Strategy) recoverByScanningTrades(ctx context.Context, session *bbgo.Ex
|
||||||
return errors.Wrap(err, "grid recover error")
|
return errors.Wrap(err, "grid recover error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// emit ready after recover
|
||||||
|
s.EmitGridReady()
|
||||||
|
|
||||||
|
// debug and send metrics
|
||||||
|
// wait for the reverse order to be placed
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
debugGrid(s.logger, s.grid, s.orderExecutor.ActiveMakerOrders())
|
||||||
|
s.updateGridNumOfOrdersMetricsWithLock()
|
||||||
|
s.updateOpenOrderPricesMetrics(s.orderExecutor.ActiveMakerOrders().Orders())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,16 +132,6 @@ func (s *Strategy) recoverWithOpenOrdersByScanningTrades(ctx context.Context, hi
|
||||||
activeOrderBook.EmitFilled(filledOrder)
|
activeOrderBook.EmitFilled(filledOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. emit grid ready
|
|
||||||
s.EmitGridReady()
|
|
||||||
|
|
||||||
// 7. debug and send metrics
|
|
||||||
// wait for the reverse order to be placed
|
|
||||||
time.Sleep(2 * time.Second)
|
|
||||||
debugGrid(s.logger, grid, s.orderExecutor.ActiveMakerOrders())
|
|
||||||
s.updateGridNumOfOrdersMetricsWithLock()
|
|
||||||
s.updateOpenOrderPricesMetrics(s.orderExecutor.ActiveMakerOrders().Orders())
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user