xgap: check sourceSymbol

This commit is contained in:
c9s 2024-11-15 23:45:03 +08:00
parent ab9faba1af
commit e67a6c56c9
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -170,7 +170,7 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
s.mu.Unlock() s.mu.Unlock()
}) })
if s.SourceExchange != "" { if s.SourceExchange != "" && s.SourceSymbol != "" {
s.sourceBook = types.NewStreamBook(s.SourceSymbol, sourceSession.ExchangeName) s.sourceBook = types.NewStreamBook(s.SourceSymbol, sourceSession.ExchangeName)
s.sourceBook.BindStream(s.sourceSession.MarketDataStream) s.sourceBook.BindStream(s.sourceSession.MarketDataStream)
} }
@ -211,7 +211,6 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
} }
s.placeOrders(ctx) s.placeOrders(ctx)
s.cancelOrders(ctx) s.cancelOrders(ctx)
} }
} }