service/backtest: use second instead of milliseconds for filtering

This commit is contained in:
c9s 2022-08-19 17:53:45 +08:00
parent 5e1e0c7661
commit 49728622bc
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -46,7 +46,7 @@ func (s *BacktestService) SyncKLineByInterval(ctx context.Context, exchange type
},
Filter: func(obj interface{}) bool {
k := obj.(types.KLine)
return !k.EndTime.Before(k.StartTime.Time().Add(k.Interval.Duration() - time.Millisecond))
return !k.EndTime.Before(k.StartTime.Time().Add(k.Interval.Duration() - time.Second))
},
ID: func(obj interface{}) string {
kline := obj.(types.KLine)