From b26141ac1f3fd5f5bdbd5c86282b89d6e58b2a9e Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 10 Jan 2022 13:51:14 +0800 Subject: [PATCH] support: set default s.triggerEMA --- pkg/strategy/support/strategy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/strategy/support/strategy.go b/pkg/strategy/support/strategy.go index 20134db03..bb76d09ff 100644 --- a/pkg/strategy/support/strategy.go +++ b/pkg/strategy/support/strategy.go @@ -289,6 +289,11 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se if s.TriggerMovingAverage != zeroiw { s.triggerEMA = standardIndicatorSet.EWMA(s.TriggerMovingAverage) + } else { + s.triggerEMA = standardIndicatorSet.EWMA(types.IntervalWindow{ + Interval: s.Interval, + Window: 99, // default window + }) } if s.LongTermMovingAverage != zeroiw {