mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1472 from c9s/c9s/grid2-check-price-for-subscribe
FIX: [grid2] subscribe 1m kline only when one of the trigger price is set
This commit is contained in:
commit
d0f9052cf2
|
@ -264,7 +264,9 @@ func (s *Strategy) Initialize() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
|
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
|
||||||
|
if !s.TriggerPrice.IsZero() || !s.StopLossPrice.IsZero() || !s.TakeProfitPrice.IsZero() {
|
||||||
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: types.Interval1m})
|
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: types.Interval1m})
|
||||||
|
}
|
||||||
|
|
||||||
if s.AutoRange != nil {
|
if s.AutoRange != nil {
|
||||||
interval := s.AutoRange.Interval()
|
interval := s.AutoRange.Interval()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user