mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
indicator: fix slice
This commit is contained in:
parent
0e18aa68f7
commit
4fd318701d
|
@ -72,7 +72,8 @@ func calculatePivotLow(lows types.Float64Slice, window int) (float64, error) {
|
|||
return 0., fmt.Errorf("insufficient elements for calculating with window = %d", window)
|
||||
}
|
||||
|
||||
min := lows[length-1-(window-1):].Min()
|
||||
end := length-1
|
||||
min := lows[end-(window-1):].Min()
|
||||
if min == lows.Index(int(window/2.)-1) {
|
||||
return min, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user