mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: move emitGridReady to earlier
This commit is contained in:
parent
e8a761e331
commit
036bae692e
|
@ -54,7 +54,7 @@ func newClosedLimitOrder(symbol string, side types.SideType, price, quantity fix
|
|||
}
|
||||
|
||||
func TestProfitFixer(t *testing.T) {
|
||||
testOrderID = 0
|
||||
testClosedOrderID = 0
|
||||
|
||||
mockCtrl := gomock.NewController(t)
|
||||
defer mockCtrl.Finish()
|
||||
|
|
|
@ -63,18 +63,19 @@ func (s *Strategy) recoverByScanningTrades(ctx context.Context, session *bbgo.Ex
|
|||
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())
|
||||
// emit ready after recover
|
||||
s.EmitGridReady()
|
||||
|
||||
defer bbgo.Sync(ctx, s)
|
||||
|
||||
if s.EnableProfitFixer {
|
||||
until := time.Now()
|
||||
since := until.Add(7 * 24 * time.Hour)
|
||||
since := until.Add(-7 * 24 * time.Hour)
|
||||
if s.FixProfitSince != nil {
|
||||
since = s.FixProfitSince.Time()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user