pivotshort: fix resistance short subscribe

This commit is contained in:
c9s 2022-08-26 17:55:59 +08:00
parent a48471d4c8
commit c8c7211e75
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,8 @@ type ResistanceShort struct {
}
func (s *ResistanceShort) Subscribe(session *bbgo.ExchangeSession) {
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.Interval})
if s.TrendEMA != nil {
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.TrendEMA.Interval})
}

View File

@ -188,7 +188,7 @@ func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
if s.ResistanceShort != nil && s.ResistanceShort.Enabled {
dynamic.InheritStructValues(s.ResistanceShort, s)
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.ResistanceShort.Interval})
s.ResistanceShort.Subscribe(session)
}
if s.BreakLow != nil {