mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
remove zero padding from RMA
This commit is contained in:
parent
4f35f21581
commit
3e5869cab3
|
@ -67,11 +67,6 @@ func (inc *RMA) Update(x float64) {
|
||||||
}
|
}
|
||||||
inc.counter++
|
inc.counter++
|
||||||
|
|
||||||
if inc.counter < inc.Window {
|
|
||||||
inc.Values.Push(0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
inc.Values.Push(inc.tmp)
|
inc.Values.Push(inc.tmp)
|
||||||
if len(inc.Values) > MaxNumOfRMA {
|
if len(inc.Values) > MaxNumOfRMA {
|
||||||
inc.Values = inc.Values[MaxNumOfRMATruncateSize-1:]
|
inc.Values = inc.Values[MaxNumOfRMATruncateSize-1:]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user