MINOR: add log when there is error at calculating and emit profit

This commit is contained in:
kbearXD 2024-03-08 14:11:04 +08:00
parent f7cce9fc9f
commit 53b72194f9

View File

@ -202,7 +202,9 @@ func (s *Strategy) runTakeProfitReady(ctx context.Context, next State) {
// reset position
// calculate profit stats
s.CalculateAndEmitProfit(ctx)
if err := s.CalculateAndEmitProfit(ctx); err != nil {
s.logger.WithError(err).Warn("failed to calculate and emit profit")
}
// reset position and open new round for profit stats before position opening
s.Position.Reset()