Compare commits

...

2 Commits

Author SHA1 Message Date
c9s
cff7103ece
fix math import
Some checks failed
Go / build (1.21, 6.2) (push) Has been cancelled
golang-lint / lint (push) Has been cancelled
2024-08-30 22:41:13 +08:00
c9s
d501e8ff4d
xmaker: apply math.Abs on signal for margin scale 2024-08-30 22:38:59 +08:00

View File

@ -3,6 +3,7 @@ package xmaker
import (
"context"
"fmt"
"math"
"sync"
"time"
@ -276,7 +277,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
return err
}
margin := scale.Call(signal)
margin := scale.Call(math.Abs(signal))
s.logger.Infof("signal margin: %f", margin)