Skip to content

Commit

Permalink
xmaker: apply math.Abs on signal for margin scale
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 30, 2024
1 parent b872138 commit d501e8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/strategy/xmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
return err
}

margin := scale.Call(signal)
margin := scale.Call(math.Abs(signal))

Check failure on line 279 in pkg/strategy/xmaker/strategy.go

View workflow job for this annotation

GitHub Actions / build (6.2, 1.21)

undefined: math

Check failure on line 279 in pkg/strategy/xmaker/strategy.go

View workflow job for this annotation

GitHub Actions / lint

undefined: math) (typecheck)

Check failure on line 279 in pkg/strategy/xmaker/strategy.go

View workflow job for this annotation

GitHub Actions / lint

undefined: math (typecheck)

s.logger.Infof("signal margin: %f", margin)

Expand Down

0 comments on commit d501e8f

Please sign in to comment.