# Pivot Based Trailing Maxima & Minima

Plots trailing maximums and minimums that reset at confirmed pivot highs and lows, plus their average: a stepped map of past and present support and resistance. Higher highs or lower lows in the trails give an immediate trend read, and a backpaint toggle aligns outputs with the price action that formed them for historical study.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Mar 14, 2022.
- Access: free.
- Concepts: [Swing High/low](https://www.luxalgo.com/library/concept/swing-high-low/) (primary), [Trailing Method Taxonomy](https://www.luxalgo.com/library/concept/trailing-method-taxonomy/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn4jm7006cvhsgf8p3yawu
- Page: https://www.luxalgo.com/library/indicator/pivot-based-trailing-maxima-minima/

**Pivot Based Trailing Maxima & Minima** tracks the running maximum and minimum of price, resets each trail when a pivot high or low confirms, and plots the average the two produce. Anchoring the resets to [swing highs and lows](https://www.luxalgo.com/library/concept/swing-high-low/) turns raw extremes into a stepped map of past and present support and resistance: levels tied to the places reversals actually formed.

## How to Trade the Pivot Based Trailing Maxima & Minima?

- **Trailing maximum stepping higher**: consecutive new highs in the trail confirm an uptrend.
- **Trailing minimum stepping lower**: persistent new lows mark a downtrend.
- **Neither trail advancing**: no fresh extremes suggests a ranging market.
- **The average line**: the midpoint of the two trails highlights the support and resistance the tool is built around.

The cadence of new extremes is itself a read on trend strength: frequent new highs speak to sustained buying pressure, sparse ones to a tiring move. Within the broader family of [trailing methods](https://www.luxalgo.com/library/concept/trailing-method-taxonomy/), resetting at structure rather than by a fixed offset is what keeps these levels aligned with the swings that matter.

## Pivot Based Trailing Maxima & Minima Settings

- **Length**: the pivot high/low lookback; increase it to reset only at longer-term tops and bottoms.
- **Backpaint**: offsets the plotted results into the past so they align with the price action that produced them; outputs remain extended to the latest bar.

## Frequently Asked Questions

### What does the Backpaint setting change?
With backpainting enabled, the trails and averages shift back over the bars that generated them, which makes historical trend analysis much cleaner. They still extend up to the most recent bar, so real-time use isn't lost. Leave it off for strictly non-offset plotting.

### Which companion tool helps anticipate the next pivot?
[Pivot High/Low Analysis & Forecast](https://www.luxalgo.com/library/indicator/pivot-high-low-analysis-forecast/) measures the spacing and magnitude between confirmed pivots and projects when the next one is statistically due, a natural partner when these trails are your structure map.

### Where can I get the indicator?
It's free through the LuxAlgo Library. You can also run it in Quant, our coding agent, without leaving this page. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Swing Highs/Lows & Candle Patterns](https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/swing-highs-lows-candle-patterns.md
- [Unreached Highs/Lows Oscillator](https://www.luxalgo.com/library/indicator/unreached-highs-lows-oscillator/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/unreached-highs-lows-oscillator.md
- [Pivot High/Low Analysis & Forecast](https://www.luxalgo.com/library/indicator/pivot-high-low-analysis-forecast/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/pivot-high-low-analysis-forecast.md
- [Liquidity Sweeps](https://www.luxalgo.com/library/indicator/liquidity-sweeps/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/liquidity-sweeps.md
- [Liquidity Swings](https://www.luxalgo.com/library/indicator/liquidity-swings/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/liquidity-swings.md
- [Price Simplification](https://www.luxalgo.com/library/indicator/price-simplification/) (Swing High/low): markdown at https://www.luxalgo.com/library/indicator/price-simplification.md
- [Signals & Overlays](https://www.luxalgo.com/library/indicator/luxalgo-signals-overlays/) (Trailing Method Taxonomy): markdown at https://www.luxalgo.com/library/indicator/luxalgo-signals-overlays.md
- [Fibonacci Trailing Stop](https://www.luxalgo.com/library/indicator/fibonacci-trailing-stop/) (Trailing Method Taxonomy): markdown at https://www.luxalgo.com/library/indicator/fibonacci-trailing-stop.md

---

Source: https://www.luxalgo.com/library/indicator/pivot-based-trailing-maxima-minima/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
