mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
fix SMA indicator value length check
This commit is contained in:
parent
aa5831686c
commit
3581c1768c
|
@ -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]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user