From ba0102e992dcef68b352c21eb64491f377ca0f8b Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 31 May 2023 13:08:21 +0800 Subject: [PATCH] pivotshort: fix find pivot func call --- pkg/strategy/pivotshort/failedbreakhigh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/strategy/pivotshort/failedbreakhigh.go b/pkg/strategy/pivotshort/failedbreakhigh.go index eb30dc91b..30ad0a32e 100644 --- a/pkg/strategy/pivotshort/failedbreakhigh.go +++ b/pkg/strategy/pivotshort/failedbreakhigh.go @@ -341,7 +341,7 @@ func (s *FailedBreakHigh) detectMacdDivergence() { var histogramPivots floats.Slice for i := pivotWindow; i > 0 && i < len(histogramValues); i++ { // find positive histogram and the top - pivot, ok := floats.CalculatePivot(histogramValues[0:i], pivotWindow, pivotWindow, func(a, pivot float64) bool { + pivot, ok := floats.FindPivot(histogramValues[0:i], pivotWindow, pivotWindow, func(a, pivot float64) bool { return pivot > 0 && pivot > a }) if ok {