pivotshort: fix find pivot func call

This commit is contained in:
c9s 2023-05-31 13:08:21 +08:00
parent 266016a278
commit ba0102e992
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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 {