diff --git a/pkg/indicator/pivot_low.go b/pkg/indicator/pivot_low.go index af27e2f44..b3bbeee3f 100644 --- a/pkg/indicator/pivot_low.go +++ b/pkg/indicator/pivot_low.go @@ -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 }