mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
merge used intervals
This commit is contained in:
parent
ec2f0cd0b1
commit
369afa8ab1
|
@ -462,14 +462,17 @@ var BacktestCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
allKLineIntervals := map[types.Interval]struct{}{}
|
||||
for _, interval := range backTestIntervals {
|
||||
allKLineIntervals[interval] = struct{}{}
|
||||
}
|
||||
|
||||
for _, session := range environ.Sessions() {
|
||||
for _, sub := range session.Subscriptions {
|
||||
if sub.Channel == types.KLineChannel {
|
||||
allKLineIntervals[types.Interval(sub.Options.Interval)] = struct{}{}
|
||||
allKLineIntervals[sub.Options.Interval] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for interval := range allKLineIntervals {
|
||||
summaryReport.Intervals = append(summaryReport.Intervals, interval)
|
||||
}
|
||||
|
@ -583,7 +586,7 @@ func createSymbolReport(userConfig *bbgo.Config, session *bbgo.ExchangeSession,
|
|||
sessionKLineIntervals := map[types.Interval]struct{}{}
|
||||
for _, sub := range session.Subscriptions {
|
||||
if sub.Channel == types.KLineChannel {
|
||||
sessionKLineIntervals[types.Interval(sub.Options.Interval)] = struct{}{}
|
||||
sessionKLineIntervals[sub.Options.Interval] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user