fix kline query endtime

This commit is contained in:
c9s 2021-10-14 14:21:38 +08:00
parent 4c2897a86d
commit 47e4847034

View File

@ -408,8 +408,7 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
for interval := range klineSubscriptions {
// avoid querying the last unclosed kline
// endTime := environ.startTime.Add(-interval.Duration())
endTime := environ.startTime.Add(-time.Millisecond)
endTime := environ.startTime.Add(-interval.Duration())
kLines, err := session.Exchange.QueryKLines(ctx, symbol, interval, types.KLineQueryOptions{
EndTime: &endTime,
Limit: 1000, // indicators need at least 100