set the defauinteralv alue to 1m

This commit is contained in:
root 2024-02-28 15:02:57 +08:00
parent 151722664f
commit 2567bd0caa
4 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,9 @@ type ProtectiveStopLoss struct {
}
func (s *ProtectiveStopLoss) Subscribe(session *ExchangeSession) {
if s.Interval == "" {
s.Interval = types.Interval1m
}
// use kline to handle roi stop
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.Interval})
}

View File

@ -21,6 +21,9 @@ type RoiStopLoss struct {
func (s *RoiStopLoss) Subscribe(session *ExchangeSession) {
// use kline to handle roi stop
if s.Interval == "" {
s.Interval = types.Interval1m
}
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.Interval})
}

View File

@ -23,6 +23,9 @@ type RoiTakeProfit struct {
func (s *RoiTakeProfit) Subscribe(session *ExchangeSession) {
// use kline to handle roi stop
if s.Interval == "" {
s.Interval = types.Interval1m
}
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.Interval})
}

View File

@ -42,6 +42,9 @@ type TrailingStop2 struct {
}
func (s *TrailingStop2) Subscribe(session *ExchangeSession) {
if s.Interval == "" {
s.Interval = types.Interval1m
}
// use 1m kline to handle roi stop
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.Interval})
}