diff --git a/pkg/bbgo/order_executor_general.go b/pkg/bbgo/order_executor_general.go index db97ae7e0..daba2999c 100644 --- a/pkg/bbgo/order_executor_general.go +++ b/pkg/bbgo/order_executor_general.go @@ -155,8 +155,10 @@ func (e *GeneralOrderExecutor) BindProfitStats(profitStats *types.ProfitStats) { profitStats.AddProfit(*profit) - Notify(profit) - Notify(profitStats) + if !e.disableNotify { + Notify(profit) + Notify(profitStats) + } }) } diff --git a/pkg/strategy/xfunding/profitstats.go b/pkg/strategy/xfunding/profitstats.go new file mode 100644 index 000000000..80467a4ce --- /dev/null +++ b/pkg/strategy/xfunding/profitstats.go @@ -0,0 +1 @@ +package xfunding diff --git a/pkg/strategy/xfunding/strategy.go b/pkg/strategy/xfunding/strategy.go index 3786d232c..174535393 100644 --- a/pkg/strategy/xfunding/strategy.go +++ b/pkg/strategy/xfunding/strategy.go @@ -843,5 +843,6 @@ func (s *Strategy) allocateOrderExecutor(ctx context.Context, session *bbgo.Exch orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) { bbgo.Sync(ctx, s) }) + orderExecutor.BindProfitStats(s.ProfitStats) return orderExecutor }