OPEN-SOURCE SCRIPT

Extrema Detector

Updated
Determines local maximums and minimums points in the chart.

Parameters:
  • lookback: number of candlesticks to look.
  • extrema_finder_sensivity: If lower, more extreme points will be found (may over-find).


Brief algorithm description:
Computes a Simple Moving Average (length=extrema_finder_sensivity), and searches for its local extremes.
Given some SMA extreme, it looks the previous extrema_finder_sensivity candlesticks to find the highest (or lowest value).

Notes:
Is a lagged indicator: determining if the current candlestick have reach a maximum can be delayed to, at most extrema_finder_sensivity-further candlesticks.

Release Notes
Fix repaint.
- When a new candlestick is added, the previous plots are deleted (lookback line and min/max labels).
Candlestick AnalysisextremesextremevaluesmaximumSimple Moving Average (SMA)Support and Resistance

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer