From 7c4b3e81df8fb2d9bcf3c6e6520dc8eb29c3502e Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 30 Aug 2024 17:42:20 +0800 Subject: [PATCH] xmaker: add more logs --- pkg/strategy/xmaker/strategy.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index df9e842a9..db4d29a5c 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -265,7 +265,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error { return err } - s.logger.Infof("final signal: %f", signal) + s.logger.Infof("aggregated signal: %f", signal) scale, err := s.SignalMarginScale.Scale() if err != nil { @@ -274,7 +274,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error { margin := scale.Call(signal) - s.logger.Infof("signalMargin: %f", margin) + s.logger.Infof("signal margin: %f", margin) marginFp := fixedpoint.NewFromFloat(margin) if signal < 0.0 { @@ -282,11 +282,15 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error { if signal <= -2.0 { // quote.BidMargin = fixedpoint.Zero } + + s.logger.Infof("adjusted bid margin: %f", quote.BidMargin.Float64()) } else if signal > 0.0 { quote.AskMargin = quote.AskMargin.Add(marginFp) if signal >= 2.0 { // quote.AskMargin = fixedpoint.Zero } + + s.logger.Infof("adjusted ask margin: %f", quote.AskMargin.Float64()) } return nil