xdepthmaker: another fix

This commit is contained in:
c9s 2024-03-06 17:19:50 +08:00
parent f5873172de
commit be89292cbb
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -324,14 +324,14 @@ func (s *Strategy) CrossRun(
return errors.New("tradesSince time can not be zero")
}
fixer := NewProfitFixer(s.makerMarket)
fixer.AddExchange(makerSession.Name, makerSession.Exchange.(types.ExchangeTradeHistoryService))
fixer.AddExchange(hedgeSession.Name, hedgeSession.Exchange.(types.ExchangeTradeHistoryService))
makerMarket, _ := s.makerSession.Market(s.Symbol)
makerMarket, _ := makerSession.Market(s.Symbol)
s.CrossExchangeMarketMakingStrategy.Position = types.NewPositionFromMarket(makerMarket)
s.CrossExchangeMarketMakingStrategy.ProfitStats = types.NewProfitStats(makerMarket)
fixer := NewProfitFixer(makerMarket)
fixer.AddExchange(makerSession.Name, makerSession.Exchange.(types.ExchangeTradeHistoryService))
fixer.AddExchange(hedgeSession.Name, hedgeSession.Exchange.(types.ExchangeTradeHistoryService))
if err2 := fixer.Fix(ctx, s.ProfitFixerConfig.TradesSince.Time(), time.Now(), s.CrossExchangeMarketMakingStrategy.ProfitStats, s.CrossExchangeMarketMakingStrategy.Position); err2 != nil {
return err2
}