Skip to content

Commit

Permalink
indicator: pull out emit update
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jul 14, 2022
1 parent bbf0127 commit 975d0d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/indicator/sma.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ func (inc *SMA) CalculateAndUpdate(allKLines []types.KLine) {
if inc.EndTime != zeroTime && k.EndTime.Before(inc.EndTime) {
continue
}

inc.PushK(k)
inc.EmitUpdate(inc.Values.Last())
}
} else {
inc.PushK(last)
inc.EmitUpdate(inc.Values.Last())
}

inc.EmitUpdate(inc.Values.Last())
}

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

0 comments on commit 975d0d6

Please sign in to comment.