mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
xfunding: bind profit stats
This commit is contained in:
parent
78c73e4514
commit
f127a530b7
|
@ -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)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user