Skip to content

Commit 975d0d6

Browse files
committed
indicator: pull out emit update
1 parent bbf0127 commit 975d0d6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/indicator/sma.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ func (inc *SMA) CalculateAndUpdate(allKLines []types.KLine) {
6969
if inc.EndTime != zeroTime && k.EndTime.Before(inc.EndTime) {
7070
continue
7171
}
72-
7372
inc.PushK(k)
74-
inc.EmitUpdate(inc.Values.Last())
7573
}
7674
} else {
7775
inc.PushK(last)
78-
inc.EmitUpdate(inc.Values.Last())
7976
}
77+
78+
inc.EmitUpdate(inc.Values.Last())
8079
}
8180

8281
func (inc *SMA) handleKLineWindowUpdate(interval types.Interval, window types.KLineWindow) {

0 commit comments

Comments
 (0)