mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
pivotshort: check TrendEMA pointer
This commit is contained in:
parent
05f6581bcd
commit
30978ecbd4
|
@ -190,7 +190,7 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
|
|||
}
|
||||
|
||||
// trend EMA protection
|
||||
if !s.TrendEMA.GradientAllowed() {
|
||||
if s.TrendEMA != nil && !s.TrendEMA.GradientAllowed() {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ func (s *ResistanceShort) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
|
|||
|
||||
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.Interval, func(kline types.KLine) {
|
||||
// trend EMA protection
|
||||
if !s.TrendEMA.GradientAllowed() {
|
||||
if s.TrendEMA != nil && !s.TrendEMA.GradientAllowed() {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user