diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index 16fc1e181..755988cb5 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -320,6 +320,29 @@ func (s *Strategy) Initialize() error { "exchange": s.MakerExchange, "symbol": s.Symbol, } + + if s.SignalReverseSideMarginScale != nil { + scale, err := s.SignalReverseSideMarginScale.Scale() + if err != nil { + return err + } + + if solveErr := scale.Solve(); solveErr != nil { + return solveErr + } + } + + if s.SignalTrendSideMarginScale != nil { + scale, err := s.SignalTrendSideMarginScale.Scale() + if err != nil { + return err + } + + if solveErr := scale.Solve(); solveErr != nil { + return solveErr + } + } + return nil } @@ -1805,10 +1828,6 @@ func (s *Strategy) CrossRun( return err } - if solveErr := scale.Solve(); solveErr != nil { - return solveErr - } - minAdditionalMargin := scale.Call(0.0) middleAdditionalMargin := scale.Call(1.0) maxAdditionalMargin := scale.Call(2.0)