bbgo: check e.disableNotify for profit stats

This commit is contained in:
c9s 2023-03-26 01:32:47 +08:00
parent e41df7e321
commit 78c73e4514
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 6 additions and 2 deletions

View File

@ -155,8 +155,10 @@ func (e *GeneralOrderExecutor) BindProfitStats(profitStats *types.ProfitStats) {
profitStats.AddProfit(*profit) profitStats.AddProfit(*profit)
if !e.disableNotify {
Notify(profit) Notify(profit)
Notify(profitStats) Notify(profitStats)
}
}) })
} }

View File

@ -0,0 +1 @@
package xfunding

View File

@ -843,5 +843,6 @@ func (s *Strategy) allocateOrderExecutor(ctx context.Context, session *bbgo.Exch
orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) { orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
bbgo.Sync(ctx, s) bbgo.Sync(ctx, s)
}) })
orderExecutor.BindProfitStats(s.ProfitStats)
return orderExecutor return orderExecutor
} }