mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
interval: avoid syncing 1s klines as default from backtest config syncSecKLines
This commit is contained in:
parent
18acd668a7
commit
763bb45842
|
@ -138,6 +138,9 @@ type Backtest struct {
|
||||||
Accounts map[string]BacktestAccount `json:"accounts" yaml:"accounts"`
|
Accounts map[string]BacktestAccount `json:"accounts" yaml:"accounts"`
|
||||||
Symbols []string `json:"symbols" yaml:"symbols"`
|
Symbols []string `json:"symbols" yaml:"symbols"`
|
||||||
Sessions []string `json:"sessions" yaml:"sessions"`
|
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 {
|
func (b *Backtest) GetAccount(n string) BacktestAccount {
|
||||||
|
|
|
@ -747,6 +747,9 @@ func sync(ctx context.Context, userConfig *bbgo.Config, backtestService *service
|
||||||
} else {
|
} else {
|
||||||
supportIntervals = types.SupportedIntervals
|
supportIntervals = types.SupportedIntervals
|
||||||
}
|
}
|
||||||
|
if !userConfig.Backtest.SyncSecKLines {
|
||||||
|
delete(supportIntervals, types.Interval1s)
|
||||||
|
}
|
||||||
|
|
||||||
// sort intervals
|
// sort intervals
|
||||||
var intervals []types.Interval
|
var intervals []types.Interval
|
||||||
|
|
Loading…
Reference in New Issue
Block a user