Skip to content

Commit

Permalink
indicator/stoch: move emitUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jul 20, 2022
1 parent 9c89359 commit 86c1619
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/indicator/stoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (inc *STOCH) PushK(k types.KLine) {

inc.Update(k.High.Float64(), k.Low.Float64(), k.Close.Float64())
inc.EndTime = k.EndTime.Time()
inc.EmitUpdate(inc.LastK(), inc.LastD())
}

func (inc *STOCH) BindK(target KLineClosedEmitter, symbol string, interval types.Interval) {
Expand All @@ -74,10 +75,8 @@ func (inc *STOCH) BindK(target KLineClosedEmitter, symbol string, interval types

func (inc *STOCH) LoadK(allKLines []types.KLine) {
for _, k := range allKLines {

inc.PushK(k)
}
inc.EmitUpdate(inc.LastK(), inc.LastD())
}

func (inc *STOCH) CalculateAndUpdate(kLines []types.KLine) {
Expand Down

0 comments on commit 86c1619

Please sign in to comment.