mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
indicator: pull out emit update
This commit is contained in:
parent
bbf01275cc
commit
975d0d6995
|
@ -69,14 +69,13 @@ func (inc *SMA) CalculateAndUpdate(allKLines []types.KLine) {
|
||||||
if inc.EndTime != zeroTime && k.EndTime.Before(inc.EndTime) {
|
if inc.EndTime != zeroTime && k.EndTime.Before(inc.EndTime) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
inc.PushK(k)
|
inc.PushK(k)
|
||||||
inc.EmitUpdate(inc.Values.Last())
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
inc.PushK(last)
|
inc.PushK(last)
|
||||||
inc.EmitUpdate(inc.Values.Last())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inc.EmitUpdate(inc.Values.Last())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (inc *SMA) handleKLineWindowUpdate(interval types.Interval, window types.KLineWindow) {
|
func (inc *SMA) handleKLineWindowUpdate(interval types.Interval, window types.KLineWindow) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user