mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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
|
// trend EMA protection
|
||||||
if !s.TrendEMA.GradientAllowed() {
|
if s.TrendEMA != nil && !s.TrendEMA.GradientAllowed() {
|
||||||
return
|
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) {
|
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.Interval, func(kline types.KLine) {
|
||||||
// trend EMA protection
|
// trend EMA protection
|
||||||
if !s.TrendEMA.GradientAllowed() {
|
if s.TrendEMA != nil && !s.TrendEMA.GradientAllowed() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user