From 156219456b975e7d93d70499736d20a05047ee80 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 19 Jun 2022 13:05:02 +0800 Subject: [PATCH] all: clean up bbgo.Notifiability --- pkg/strategy/autoborrow/strategy.go | 2 -- pkg/strategy/bollgrid/strategy.go | 4 ---- pkg/strategy/bollmaker/strategy.go | 1 - pkg/strategy/dca/strategy.go | 1 - pkg/strategy/emastop/strategy.go | 4 ---- pkg/strategy/etf/strategy.go | 2 -- pkg/strategy/fmaker/strategy.go | 1 - pkg/strategy/funding/strategy.go | 1 - pkg/strategy/grid/strategy.go | 4 ---- pkg/strategy/schedule/strategy.go | 2 -- pkg/strategy/swing/strategy.go | 4 ---- pkg/strategy/techsignal/strategy.go | 2 -- pkg/strategy/wall/strategy.go | 1 - pkg/strategy/xbalance/strategy.go | 1 - pkg/strategy/xgap/strategy.go | 1 - pkg/strategy/xmaker/strategy.go | 1 - pkg/strategy/xnav/strategy.go | 1 - 17 files changed, 33 deletions(-) diff --git a/pkg/strategy/autoborrow/strategy.go b/pkg/strategy/autoborrow/strategy.go index f68949b7cd..77b65f6a24 100644 --- a/pkg/strategy/autoborrow/strategy.go +++ b/pkg/strategy/autoborrow/strategy.go @@ -50,8 +50,6 @@ type MarginAsset struct { } type Strategy struct { - *bbgo.Notifiability - Interval types.Interval `json:"interval"` MinMarginLevel fixedpoint.Value `json:"minMarginLevel"` MaxMarginLevel fixedpoint.Value `json:"maxMarginLevel"` diff --git a/pkg/strategy/bollgrid/strategy.go b/pkg/strategy/bollgrid/strategy.go index 84c9ff2c09..8d689f7d47 100644 --- a/pkg/strategy/bollgrid/strategy.go +++ b/pkg/strategy/bollgrid/strategy.go @@ -25,10 +25,6 @@ func init() { } type Strategy struct { - // The notification system will be injected into the strategy automatically. - // This field will be injected automatically since it's a single exchange strategy. - *bbgo.Notifiability - // OrderExecutor is an interface for submitting order. // This field will be injected automatically since it's a single exchange strategy. bbgo.OrderExecutor diff --git a/pkg/strategy/bollmaker/strategy.go b/pkg/strategy/bollmaker/strategy.go index 7bd900895b..597834ed80 100644 --- a/pkg/strategy/bollmaker/strategy.go +++ b/pkg/strategy/bollmaker/strategy.go @@ -51,7 +51,6 @@ type BollingerSetting struct { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/dca/strategy.go b/pkg/strategy/dca/strategy.go index 0495cbd01b..932eb570ef 100644 --- a/pkg/strategy/dca/strategy.go +++ b/pkg/strategy/dca/strategy.go @@ -48,7 +48,6 @@ func (b BudgetPeriod) Duration() time.Duration { // Strategy is the Dollar-Cost-Average strategy type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/emastop/strategy.go b/pkg/strategy/emastop/strategy.go index 396568c8ee..89c837b370 100644 --- a/pkg/strategy/emastop/strategy.go +++ b/pkg/strategy/emastop/strategy.go @@ -27,10 +27,6 @@ func init() { type Strategy struct { *bbgo.Graceful - // The notification system will be injected into the strategy automatically. - // This field will be injected automatically since it's a single exchange strategy. - *bbgo.Notifiability - SourceExchangeName string `json:"sourceExchange"` TargetExchangeName string `json:"targetExchange"` diff --git a/pkg/strategy/etf/strategy.go b/pkg/strategy/etf/strategy.go index 936be77198..f14c0a102d 100644 --- a/pkg/strategy/etf/strategy.go +++ b/pkg/strategy/etf/strategy.go @@ -22,8 +22,6 @@ func init() { type Strategy struct { Market types.Market - Notifiability *bbgo.Notifiability - TotalAmount fixedpoint.Value `json:"totalAmount,omitempty"` // Interval is the period that you want to submit order diff --git a/pkg/strategy/fmaker/strategy.go b/pkg/strategy/fmaker/strategy.go index 0c1ab78b25..d67367569b 100644 --- a/pkg/strategy/fmaker/strategy.go +++ b/pkg/strategy/fmaker/strategy.go @@ -32,7 +32,6 @@ type IntervalWindowSetting struct { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/funding/strategy.go b/pkg/strategy/funding/strategy.go index e6b3b5ae6b..83d0a871df 100644 --- a/pkg/strategy/funding/strategy.go +++ b/pkg/strategy/funding/strategy.go @@ -27,7 +27,6 @@ func init() { } type Strategy struct { - *bbgo.Notifiability // These fields will be filled from the config file (it translates YAML to JSON) Symbol string `json:"symbol"` Market types.Market `json:"-"` diff --git a/pkg/strategy/grid/strategy.go b/pkg/strategy/grid/strategy.go index a132704c58..75e7817831 100644 --- a/pkg/strategy/grid/strategy.go +++ b/pkg/strategy/grid/strategy.go @@ -45,10 +45,6 @@ type State struct { } type Strategy struct { - // The notification system will be injected into the strategy automatically. - // This field will be injected automatically since it's a single exchange strategy. - *bbgo.Notifiability `json:"-" yaml:"-"` - *bbgo.Graceful `json:"-" yaml:"-"` *bbgo.Persistence diff --git a/pkg/strategy/schedule/strategy.go b/pkg/strategy/schedule/strategy.go index de5bd7e302..82ad3ecf5b 100644 --- a/pkg/strategy/schedule/strategy.go +++ b/pkg/strategy/schedule/strategy.go @@ -19,8 +19,6 @@ func init() { type Strategy struct { Market types.Market - Notifiability *bbgo.Notifiability - // StandardIndicatorSet contains the standard indicators of a market (symbol) // This field will be injected automatically since we defined the Symbol field. *bbgo.StandardIndicatorSet diff --git a/pkg/strategy/swing/strategy.go b/pkg/strategy/swing/strategy.go index 721d4a8be3..da85591ce2 100644 --- a/pkg/strategy/swing/strategy.go +++ b/pkg/strategy/swing/strategy.go @@ -26,10 +26,6 @@ func init() { } type Strategy struct { - // The notification system will be injected into the strategy automatically. - // This field will be injected automatically since it's a single exchange strategy. - *bbgo.Notifiability - // OrderExecutor is an interface for submitting order. // This field will be injected automatically since it's a single exchange strategy. bbgo.OrderExecutor diff --git a/pkg/strategy/techsignal/strategy.go b/pkg/strategy/techsignal/strategy.go index efe7e57cfd..e95c970d1d 100644 --- a/pkg/strategy/techsignal/strategy.go +++ b/pkg/strategy/techsignal/strategy.go @@ -28,8 +28,6 @@ func init() { } type Strategy struct { - *bbgo.Notifiability - // These fields will be filled from the config file (it translates YAML to JSON) Symbol string `json:"symbol"` Market types.Market `json:"-"` diff --git a/pkg/strategy/wall/strategy.go b/pkg/strategy/wall/strategy.go index 915c7fb3b5..824cc28cf9 100644 --- a/pkg/strategy/wall/strategy.go +++ b/pkg/strategy/wall/strategy.go @@ -31,7 +31,6 @@ func init() { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/xbalance/strategy.go b/pkg/strategy/xbalance/strategy.go index 6a8c1b0353..4ac0e851b6 100644 --- a/pkg/strategy/xbalance/strategy.go +++ b/pkg/strategy/xbalance/strategy.go @@ -136,7 +136,6 @@ func (a *Address) UnmarshalJSON(body []byte) error { } type Strategy struct { - Notifiability *bbgo.Notifiability *bbgo.Graceful *bbgo.Persistence diff --git a/pkg/strategy/xgap/strategy.go b/pkg/strategy/xgap/strategy.go index d82161e12c..102ea2a42c 100644 --- a/pkg/strategy/xgap/strategy.go +++ b/pkg/strategy/xgap/strategy.go @@ -58,7 +58,6 @@ func (s *State) Reset() { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Symbol string `json:"symbol"` diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index 79c1329e07..289b942083 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -34,7 +34,6 @@ func init() { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/xnav/strategy.go b/pkg/strategy/xnav/strategy.go index afbf65c1bb..f11582efb3 100644 --- a/pkg/strategy/xnav/strategy.go +++ b/pkg/strategy/xnav/strategy.go @@ -58,7 +58,6 @@ func (s *State) Reset() { } type Strategy struct { - Notifiability *bbgo.Notifiability *bbgo.Graceful *bbgo.Persistence *bbgo.Environment