indicator/stoch: simplify CalculateAndUpdate

This commit is contained in:
c9s 2022-07-21 01:35:27 +08:00
parent 86c1619e50
commit ea08a61e28
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -85,14 +85,8 @@ func (inc *STOCH) CalculateAndUpdate(kLines []types.KLine) {
}
for _, k := range kLines {
if inc.EndTime != zeroTime && !k.EndTime.After(inc.EndTime) {
continue
}
inc.PushK(k)
}
inc.EmitUpdate(inc.LastK(), inc.LastD())
}
func (inc *STOCH) handleKLineWindowUpdate(interval types.Interval, window types.KLineWindow) {