From ac75767a118d0a47e99941485e10bc1f5a6171ad 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 ab5ba7a..53552f9 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)