mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
backtest: return closed kline channel when empty symbol is given
This commit is contained in:
parent
470eb7dc09
commit
7a48d001a2
|
@ -382,6 +382,14 @@ func (e *Exchange) SubscribeMarketData(
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("querying klines from database with exchange: %v symbols: %v and intervals: %v for back-testing", e.Name(), symbols, intervals)
|
log.Infof("querying klines from database with exchange: %v symbols: %v and intervals: %v for back-testing", e.Name(), symbols, intervals)
|
||||||
|
if len(symbols) == 0 {
|
||||||
|
log.Warnf("empty symbols, will not query kline data from the database")
|
||||||
|
|
||||||
|
c := make(chan types.KLine)
|
||||||
|
close(c)
|
||||||
|
return c, nil
|
||||||
|
}
|
||||||
|
|
||||||
klineC, errC := e.srv.QueryKLinesCh(startTime, endTime, e, symbols, intervals)
|
klineC, errC := e.srv.QueryKLinesCh(startTime, endTime, e, symbols, intervals)
|
||||||
go func() {
|
go func() {
|
||||||
if err := <-errC; err != nil {
|
if err := <-errC; err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user