From 90020a65a4c0d707264b4b542c8a272393785e3b Mon Sep 17 00:00:00 2001 From: Andy Cheng Date: Tue, 2 Jan 2024 16:56:38 +0800 Subject: [PATCH] improve/sync-futures: do not use GetSessionAttributes() --- pkg/backtest/exchange.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/backtest/exchange.go b/pkg/backtest/exchange.go index 183b41c39..b0600d54f 100644 --- a/pkg/backtest/exchange.go +++ b/pkg/backtest/exchange.go @@ -30,7 +30,6 @@ package backtest import ( "context" "fmt" - exchange2 "github.com/c9s/bbgo/pkg/exchange" "strconv" "sync" "time" @@ -382,7 +381,14 @@ func (e *Exchange) SubscribeMarketData( intervals = append(intervals, interval) } - _, isFutures, _, _ := exchange2.GetSessionAttributes(e.publicExchange) + //_, isFutures, _, _ := exchange2.GetSessionAttributes(e.publicExchange) + var isFutures bool + if futuresExchange, ok := e.publicExchange.(types.FuturesExchange); ok { + isFutures = futuresExchange.GetFuturesSettings().IsFutures + } else { + isFutures = false + } + if isFutures { log.Infof("querying futures klines from database with exchange: %v symbols: %v and intervals: %v for back-testing", e.Name(), symbols, intervals) } else {