support: set default s.triggerEMA

This commit is contained in:
c9s 2022-01-10 13:51:14 +08:00
parent b56e988fc9
commit b26141ac1f

View File

@ -289,6 +289,11 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
if s.TriggerMovingAverage != zeroiw { if s.TriggerMovingAverage != zeroiw {
s.triggerEMA = standardIndicatorSet.EWMA(s.TriggerMovingAverage) s.triggerEMA = standardIndicatorSet.EWMA(s.TriggerMovingAverage)
} else {
s.triggerEMA = standardIndicatorSet.EWMA(types.IntervalWindow{
Interval: s.Interval,
Window: 99, // default window
})
} }
if s.LongTermMovingAverage != zeroiw { if s.LongTermMovingAverage != zeroiw {