From d501e8ff4dff91388f4d2c4bd02d8b8216549e2d Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 30 Aug 2024 22:38:35 +0800 Subject: [PATCH] xmaker: apply math.Abs on signal for margin scale --- pkg/strategy/xmaker/strategy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index 879df048b..d2f23f3e0 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -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)) s.logger.Infof("signal margin: %f", margin)