mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
refactor for BatchQueryKLineWindows
This commit is contained in:
parent
6e405eb443
commit
163036c745
|
@ -479,5 +479,18 @@ func (e *Exchange) BatchQueryKLines(ctx context.Context, symbol, interval string
|
|||
}
|
||||
|
||||
return allKLines, nil
|
||||
|
||||
}
|
||||
|
||||
func (e *Exchange) BatchQueryKLineWindows(ctx context.Context, symbol string, intervals []string, startTime, endTime time.Time) (map[string]types.KLineWindow, error) {
|
||||
klineWindows := map[string]types.KLineWindow{}
|
||||
for _, interval := range intervals {
|
||||
klines, err := e.BatchQueryKLines(ctx, symbol, interval, startTime, endTime)
|
||||
if err != nil {
|
||||
return klineWindows, err
|
||||
}
|
||||
klineWindows[interval] = klines
|
||||
}
|
||||
|
||||
return klineWindows, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user