diff --git a/pkg/bbgo/order_executor_general.go b/pkg/bbgo/order_executor_general.go index cf7924afb..a3ce04572 100644 --- a/pkg/bbgo/order_executor_general.go +++ b/pkg/bbgo/order_executor_general.go @@ -68,18 +68,18 @@ func (e *GeneralOrderExecutor) BindProfitStats(profitStats *types.ProfitStats) { }) } -func (e *GeneralOrderExecutor) Bind(notify NotifyFunc) { +func (e *GeneralOrderExecutor) Bind() { e.activeMakerOrders.BindStream(e.session.UserDataStream) e.orderStore.BindStream(e.session.UserDataStream) // trade notify e.tradeCollector.OnTrade(func(trade types.Trade, profit, netProfit fixedpoint.Value) { - notify(trade) + Notify(trade) }) e.tradeCollector.OnPositionUpdate(func(position *types.Position) { log.Infof("position changed: %s", position) - notify(position) + Notify(position) }) e.tradeCollector.BindStream(e.session.UserDataStream) diff --git a/pkg/strategy/pivotshort/strategy.go b/pkg/strategy/pivotshort/strategy.go index aa32dcf27..fc7f53a37 100644 --- a/pkg/strategy/pivotshort/strategy.go +++ b/pkg/strategy/pivotshort/strategy.go @@ -78,7 +78,6 @@ type Exit struct { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment @@ -204,7 +203,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se s.orderExecutor.BindEnvironment(s.Environment) s.orderExecutor.BindProfitStats(s.ProfitStats) s.orderExecutor.BindTradeStats(s.TradeStats) - s.orderExecutor.Bind(s.Notifiability.Notify) + s.orderExecutor.Bind() store, _ := session.MarketDataStore(s.Symbol) diff --git a/pkg/strategy/pricealert/strategy.go b/pkg/strategy/pricealert/strategy.go index c22da9178..f6b15c6ee 100644 --- a/pkg/strategy/pricealert/strategy.go +++ b/pkg/strategy/pricealert/strategy.go @@ -15,9 +15,6 @@ func init() { } type Strategy struct { - // The notification system will be injected into the strategy automatically. - *bbgo.Notifiability - // These fields will be filled from the config file (it translates YAML to JSON) Symbol string `json:"symbol"` Interval types.Interval `json:"interval"` diff --git a/pkg/strategy/rebalance/strategy.go b/pkg/strategy/rebalance/strategy.go index 6d9f5ccdb..45ce699b1 100644 --- a/pkg/strategy/rebalance/strategy.go +++ b/pkg/strategy/rebalance/strategy.go @@ -20,8 +20,6 @@ func init() { } type Strategy struct { - Notifiability *bbgo.Notifiability - Interval types.Interval `json:"interval"` BaseCurrency string `json:"baseCurrency"` TargetWeights types.ValueMap `json:"targetWeights"` diff --git a/pkg/strategy/supertrend/strategy.go b/pkg/strategy/supertrend/strategy.go index 680f9b7e3..bef71b602 100644 --- a/pkg/strategy/supertrend/strategy.go +++ b/pkg/strategy/supertrend/strategy.go @@ -29,7 +29,6 @@ func init() { type Strategy struct { *bbgo.Graceful - *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment diff --git a/pkg/strategy/support/strategy.go b/pkg/strategy/support/strategy.go index f1e4285fb..676fa1dd7 100644 --- a/pkg/strategy/support/strategy.go +++ b/pkg/strategy/support/strategy.go @@ -130,7 +130,6 @@ func (control *TrailingStopControl) GenerateStopOrder(quantity fixedpoint.Value) // } type Strategy struct { - *bbgo.Notifiability `json:"-"` *bbgo.Persistence *bbgo.Graceful `json:"-"`