Merge pull request #1723 from c9s/c9s/xmaker/add-signals

FIX: [xmaker] avoid calculate margin from 0.0 signal
This commit is contained in:
c9s 2024-08-30 18:01:57 +08:00 committed by GitHub
commit b87213827e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,6 +267,10 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
s.logger.Infof("aggregated signal: %f", signal)
if signal == 0.0 {
return nil
}
scale, err := s.SignalMarginScale.Scale()
if err != nil {
return err