From e67a6c56c9c51a720ee4a7f7db7348b1723e79eb Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 23:45:03 +0800 Subject: [PATCH] xgap: check sourceSymbol --- pkg/strategy/xgap/strategy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/strategy/xgap/strategy.go b/pkg/strategy/xgap/strategy.go index 596ca079f..ae81e5284 100644 --- a/pkg/strategy/xgap/strategy.go +++ b/pkg/strategy/xgap/strategy.go @@ -170,7 +170,7 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se s.mu.Unlock() }) - if s.SourceExchange != "" { + if s.SourceExchange != "" && s.SourceSymbol != "" { s.sourceBook = types.NewStreamBook(s.SourceSymbol, sourceSession.ExchangeName) s.sourceBook.BindStream(s.sourceSession.MarketDataStream) } @@ -211,7 +211,6 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se } s.placeOrders(ctx) - s.cancelOrders(ctx) } }