PINE LIBRARY

FunctionPeakDetection

Updated
Library "FunctionPeakDetection"
Method used for peak detection, similar to MATLAB peakdet method

function(sample_x, sample_y, delta) Method for detecting peaks.
  Parameters:
    sample_x: float array, sample with indices.
    sample_y: float array, sample with data.
    delta: float, positive threshold value for detecting a peak.
  Returns: tuple with found max/min peak indices.
Release Notes
v2
fixed issue with example usage were it would crash in replay/large history buffer.
analysisarraysstatistics

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer