mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
indicator: drop unused code
This commit is contained in:
parent
b141ae3ece
commit
0b01750528
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user