fix stopEMA range check

This commit is contained in:
c9s 2022-06-29 16:59:50 +08:00
parent 83d6f4764c
commit 4bb2e4a25f
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -337,7 +337,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
log.Infof("%s breakLow signal detected, closed price %f < breakPrice %f", kline.Symbol, closePrice.Float64(), breakPrice.Float64())
// stop EMA protection
if s.stopEWMA != nil && !s.BreakLow.StopEMARange.IsZero() {
if s.stopEWMA != nil {
ema := fixedpoint.NewFromFloat(s.stopEWMA.Last())
if ema.IsZero() {
return