xfunding: bind profit stats

This commit is contained in:
c9s 2023-03-26 01:33:52 +08:00
parent 78c73e4514
commit f127a530b7
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -837,9 +837,6 @@ func (s *Strategy) allocateOrderExecutor(ctx context.Context, session *bbgo.Exch
orderExecutor.SetMaxRetries(0) orderExecutor.SetMaxRetries(0)
orderExecutor.BindEnvironment(s.Environment) orderExecutor.BindEnvironment(s.Environment)
orderExecutor.Bind() orderExecutor.Bind()
orderExecutor.TradeCollector().OnTrade(func(trade types.Trade, _, _ fixedpoint.Value) {
s.ProfitStats.AddTrade(trade)
})
orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) { orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
bbgo.Sync(ctx, s) bbgo.Sync(ctx, s)
}) })