Skip to content

Commit

Permalink
improve/sync-futures: do not use GetSessionAttributes()
Browse files Browse the repository at this point in the history
  • Loading branch information
andycheng123 committed Jan 2, 2024
1 parent d2f946e commit 90020a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/backtest/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package backtest
import (
"context"
"fmt"
exchange2 "github.com/c9s/bbgo/pkg/exchange"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 90020a6

Please sign in to comment.