OPEN-SOURCE SCRIPT

Trend Pivot Retracements [TradeEasy]

502
▶ OVERVIEW
Trend Pivot Retracements [TradeEasy] identifies market trend direction using a Donchian-style channel and dynamically highlights retracement zones during trending conditions. It calculates the percentage pullbacks from recent highs and lows, plots labeled zones with varying intensity, and visually connects key retracement pivots. The indicator also emphasizes price proximity to trend boundaries by dynamically adjusting the thickness of plotted trend bands.

▶ TREND DETECTION & BAND STRUCTURE
The indicator determines the current trend by checking for new 50-bar extremes:
Uptrend: If a new highest high is made, the trend is considered bullish.
Downtrend: If a new lowest low is made, the trend is considered bearish.
Uptrend Band: Plots the 50-bar lowest low as a trailing support level.
Downtrend Band: Plots the 50-bar highest high as a trailing resistance level.
Thickness Variation: The thickness of the band increases the further price moves from it, indicating overextension.


▶ RETRACEMENT LABELING SYSTEM
During a trend, the indicator monitors pivot points in the opposite direction to measure retracements:
Bullish Retracement:

Triggered when a pivot low forms during an uptrend.
Measures % pullback from the most recent swing high (searched up to 20 bars back).
Plots a bold horizontal line at the low and a dashed diagonal from the previous swing high.
Adds a “-%” label above the low; intensity is based on recent 50 pullbacks.

Bearish Retracement:

Triggered when a pivot high forms during a downtrend.
Measures % pullback from the previous swing low (up to 20 bars back).
Plots a bold horizontal line at the high and a dashed diagonal from the prior swing low.
Adds a “%” label below the high with gradient color based on the past 50 extremes.


▶ PIVOT CONNECTION LINES
Each retracement includes a visual connector:
A diagonal dashed line linking the swing extreme (20 bars back) to the retracement point.
This line visually traces the path of price retreat within the trend.
Helps traders understand where the retracement originated and how steep it was.


▶ TREND SWITCH SIGNALS
When trend direction changes:
A diamond marker is plotted on the new pivot confirming the trend shift.
Green diamonds signal new bullish trends at fresh lows.
Magenta diamonds signal new bearish trends at fresh highs.


▶ COLOR INTENSITY & CONTEXTUAL AWARENESS
To help interpret the magnitude of retracements:
The % labels are color-coded using a gradient scale that references the max of the last 50 pullbacks.
Stronger pullbacks result in deeper color intensity, signaling more significant corrections.
Trend bands also use standard deviation normalization to adjust line thickness based on how far price has moved from the band.
This creates a visual cue for potential exhaustion or volatility extremes.


▶ USAGE

Trend Pivot Retracements is a powerful tool for traders who want to:
Identify trend direction and contextual pullbacks within those trends.
Spot key retracement points that may serve as entry opportunities or reversal signals.
Use visual retracement angles to understand market pressure and trend maturity.
Read dynamic band thickness as an alert for price stretch, potential mean reversion, or breakout setups.


▶ CONCLUSION
Trend Pivot Retracements [TradeEasy] gives traders a clean, visually expressive way to monitor trending markets, while capturing and labeling meaningful retracements. With adaptive color intensity, diagonal connectors, and smart trend switching, it enhances situational awareness and provides immediate clarity on trend health and pullback strength.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.