fix SMA indicator value length check

This commit is contained in:
c9s 2021-10-14 14:22:07 +08:00
parent aa5831686c
commit 3581c1768c

View File

@ -24,6 +24,9 @@ type SMA struct {
}
func (inc *SMA) Last() float64 {
if len(inc.Values) == 0 {
return 0.0
}
return inc.Values[len(inc.Values)-1]
}