From 2567bd0caa2157bd49a0286ef69a782222c9a985 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Feb 2024 15:02:57 +0800 Subject: [PATCH] set the defauinteralv alue to 1m --- pkg/bbgo/exit_protective_stop_loss.go | 3 +++ pkg/bbgo/exit_roi_stop_loss.go | 3 +++ pkg/bbgo/exit_roi_take_profit.go | 3 +++ pkg/bbgo/exit_trailing_stop.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/pkg/bbgo/exit_protective_stop_loss.go b/pkg/bbgo/exit_protective_stop_loss.go index 5e35858b0..a1de551ba 100644 --- a/pkg/bbgo/exit_protective_stop_loss.go +++ b/pkg/bbgo/exit_protective_stop_loss.go @@ -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}) } diff --git a/pkg/bbgo/exit_roi_stop_loss.go b/pkg/bbgo/exit_roi_stop_loss.go index ad8d5689a..43b0431ce 100644 --- a/pkg/bbgo/exit_roi_stop_loss.go +++ b/pkg/bbgo/exit_roi_stop_loss.go @@ -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}) } diff --git a/pkg/bbgo/exit_roi_take_profit.go b/pkg/bbgo/exit_roi_take_profit.go index 60672f5e8..2efcba785 100644 --- a/pkg/bbgo/exit_roi_take_profit.go +++ b/pkg/bbgo/exit_roi_take_profit.go @@ -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}) } diff --git a/pkg/bbgo/exit_trailing_stop.go b/pkg/bbgo/exit_trailing_stop.go index a46024c34..5c6360af9 100644 --- a/pkg/bbgo/exit_trailing_stop.go +++ b/pkg/bbgo/exit_trailing_stop.go @@ -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}) }