Skip to content

Commit

Permalink
indicator: drop unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 1, 2023
1 parent b141ae3 commit 0b01750
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions pkg/indicator/tma.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,3 @@ var _ types.SeriesExtend = &TMA{}
func (inc *TMA) PushK(k types.KLine) {
inc.Update(k.Close.Float64())
}

func (inc *TMA) CalculateAndUpdate(allKLines []types.KLine) {
if inc.s1 == nil {
for _, k := range allKLines {
inc.PushK(k)
inc.EmitUpdate(inc.Last(0))
}
} else {
k := allKLines[len(allKLines)-1]
inc.PushK(k)
inc.EmitUpdate(inc.Last(0))
}
}

func (inc *TMA) handleKLineWindowUpdate(interval types.Interval, window types.KLineWindow) {
if inc.Interval != interval {
return
}

inc.CalculateAndUpdate(window)
}

func (inc *TMA) Bind(updater KLineWindowUpdater) {
updater.OnKLineWindowUpdate(inc.handleKLineWindowUpdate)
}

0 comments on commit 0b01750

Please sign in to comment.