bbgo: do not sync trades when running backtest

This commit is contained in:
c9s 2021-12-23 23:20:35 +08:00
parent f5bbe29ac6
commit a3e3e1d177

View File

@ -387,7 +387,7 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
var err error
var trades []types.Trade
if environ.SyncService != nil {
if environ.SyncService != nil && environ.BacktestService == nil {
tradingFeeCurrency := session.Exchange.PlatformFeeCurrency()
if strings.HasPrefix(symbol, tradingFeeCurrency) {
trades, err = environ.TradeService.QueryForTradingFeeCurrency(session.Exchange.Name(), symbol, tradingFeeCurrency)