From 5999dc115177c5d9b9f52318f7686fdbae20cc35 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 31 Dec 2021 02:00:39 +0800 Subject: [PATCH] xmaker: fix s.state.CoveredPosition.AtomicAdd add --- pkg/strategy/xmaker/strategy.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index d1c176e34..357b0c34d 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -748,10 +748,7 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order s.tradeCollector.OnTrade(func(trade types.Trade) { c := trade.PositionChange() s.state.HedgePosition.AtomicAdd(c) - if trade.Exchange == s.sourceSession.ExchangeName { - s.state.CoveredPosition.AtomicAdd(c) - } - + s.state.CoveredPosition.AtomicAdd(c) s.state.ProfitStats.AddTrade(trade) if err := s.SaveState(); err != nil {