pivotshort: fix tail function

This commit is contained in:
c9s 2022-07-25 15:02:59 +08:00
parent bfb7dd51d6
commit 0d5d92b26d
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -72,7 +72,7 @@ func (s *ResistanceShort) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
}
func tail(arr []float64, length int) []float64 {
if len(arr) < length {
if len(arr) == 0 || len(arr) < length {
return arr
}