Skip to content

Commit 763bb45

Browse files
committed
interval: avoid syncing 1s klines as default from backtest config syncSecKLines
1 parent 18acd66 commit 763bb45

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/bbgo/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ type Backtest struct {
138138
Accounts map[string]BacktestAccount `json:"accounts" yaml:"accounts"`
139139
Symbols []string `json:"symbols" yaml:"symbols"`
140140
Sessions []string `json:"sessions" yaml:"sessions"`
141+
142+
// sync 1 second interval KLines
143+
SyncSecKLines bool `json:"syncSecKLines,omitempty" yaml:"syncSecKLines,omitempty"`
141144
}
142145

143146
func (b *Backtest) GetAccount(n string) BacktestAccount {

pkg/cmd/backtest.go

+3
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,9 @@ func sync(ctx context.Context, userConfig *bbgo.Config, backtestService *service
747747
} else {
748748
supportIntervals = types.SupportedIntervals
749749
}
750+
if !userConfig.Backtest.SyncSecKLines {
751+
delete(supportIntervals, types.Interval1s)
752+
}
750753

751754
// sort intervals
752755
var intervals []types.Interval

0 commit comments

Comments
 (0)