Skip to content

Commit

Permalink
pivotshort: fix resistance short subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 26, 2022
1 parent a48471d commit c8c7211
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/strategy/pivotshort/resistance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/strategy/pivotshort/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c8c7211

Please sign in to comment.