interval: avoid syncing 1s klines as default from backtest config syncSecKLines

This commit is contained in:
austin362667 2022-10-04 22:04:09 +08:00 committed by Austin Liu
parent 18acd668a7
commit 763bb45842
2 changed files with 6 additions and 0 deletions

View File

@ -138,6 +138,9 @@ type Backtest struct {
Accounts map[string]BacktestAccount `json:"accounts" yaml:"accounts"`
Symbols []string `json:"symbols" yaml:"symbols"`
Sessions []string `json:"sessions" yaml:"sessions"`
// sync 1 second interval KLines
SyncSecKLines bool `json:"syncSecKLines,omitempty" yaml:"syncSecKLines,omitempty"`
}
func (b *Backtest) GetAccount(n string) BacktestAccount {

View File

@ -747,6 +747,9 @@ func sync(ctx context.Context, userConfig *bbgo.Config, backtestService *service
} else {
supportIntervals = types.SupportedIntervals
}
if !userConfig.Backtest.SyncSecKLines {
delete(supportIntervals, types.Interval1s)
}
// sort intervals
var intervals []types.Interval