improve/sync-futures: do not use GetSessionAttributes()

This commit is contained in:
Andy Cheng 2024-01-02 16:56:38 +08:00
parent d2f946e349
commit 90020a65a4
No known key found for this signature in database
GPG Key ID: 936427CF651A9D28

View File

@ -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 {