mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
xmaker: fix s.state.CoveredPosition.AtomicAdd add
This commit is contained in:
parent
63ccc2d3d0
commit
5999dc1151
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user