grid2: emit grid profit after profit stats fix

This commit is contained in:
c9s 2023-04-27 00:33:42 +08:00
parent 46a6d896a2
commit 32b2c43198
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 5 additions and 1 deletions

View File

@ -89,6 +89,8 @@ func (s *Strategy) recoverByScanningTrades(ctx context.Context, session *bbgo.Ex
}
s.logger.Infof("fixed profitStats: %#v", s.GridProfitStats)
s.EmitGridProfit(s.GridProfitStats, nil)
}
return nil

View File

@ -1852,7 +1852,9 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
s.orderExecutor = orderExecutor
s.OnGridProfit(func(stats *GridProfitStats, profit *GridProfit) {
bbgo.Notify(profit)
if profit != nil {
bbgo.Notify(profit)
}
bbgo.Notify(stats)
})