Dynamic Swing Retracement Tracker

Methodology:
Directional Bias Filter: Utilizes two exponential moving averages (configurable periods, default 50 and 200) as a momentum comparison mechanism. When the faster average exceeds the slower average, bullish bias is established; the inverse confirms bearish bias.
Automated Swing Recognition: The script continuously scans for local price extremes using pivot analysis with a user-defined lookback window (default 36 bars). These extremes become anchor points for calculating potential retracement zones.
Geometric Retracement Zones: Between each pair of swing extremes, the script calculates key mathematical ratios (0.5 and 0.618) to identify zones where price is statistically likely to find support or resistance during pullbacks. These zones are used for signal generation but remain invisible on the chart.
Signal Generation Logic:
Long entry signals appear when price retraces into calculated zones during bullish bias conditions
Short entry signals appear when price retraces into zones during bearish bias conditions
All signals require full candle confirmation to eliminate intra-bar noise
A customizable cooldown mechanism prevents signal clustering
Automated Risk Visualization:
Invalidation level (traditionally called "stop loss") placed beyond the most recent swing extreme, with adjustable pip buffer for spread accommodation
Three progressive target zones calculated using geometric extensions (1.618x, 2.0x, and 2.618x multiples of the original swing range)
All price levels displayed as horizontal reference lines spanning 20 bars (10 before, 10 after the signal candle
Technical Implementation:
Swing detection uses TradingView's built-in pivot functions with symmetric lookback
Retracement calculations based on classical golden ratio mathematics
Label positioning dynamically adjusts using Average True Range to maintain visibility across different volatility conditions
All drawing objects are refreshed on each bar to comply with platform object limits
Practical Application:
This tool is designed for traders who want to systematically identify counter-trend entries within established trends. Rather than manually drawing retracement levels, the indicator automates the process and provides immediate visual feedback on potential entry zones with pre-calculated risk and reward parameters.
Customization Options:
Momentum filter periods (default 50/200)
Swing detection sensitivity
Signal spacing controls
Risk buffer adjustment
Individual component visibility toggles
Important Notes:
This indicator does not predict future price movements. It identifies historical swing patterns and mathematically-derived levels based on past price action. All trading decisions should be made in conjunction with proper risk management and market analysis.
Script sob convite
Somente usuários aprovados pelo autor podem acessar este script. Você precisará solicitar e obter permissão para usá-lo. Normalmente, essa permissão é concedida após o pagamento. Para obter mais detalhes, siga as instruções do autor abaixo ou entre em contato diretamente com RB_T.
A TradingView NÃO recomenda pagar ou usar um script, a menos que você confie totalmente em seu autor e entenda como ele funciona. Você também pode encontrar alternativas gratuitas e de código aberto em nossos scripts da comunidade.
Instruções do autor
Learn more: rbtrading.substack.com/p/premium-tradingview-indicators-hub
Aviso legal
Script sob convite
Somente usuários aprovados pelo autor podem acessar este script. Você precisará solicitar e obter permissão para usá-lo. Normalmente, essa permissão é concedida após o pagamento. Para obter mais detalhes, siga as instruções do autor abaixo ou entre em contato diretamente com RB_T.
A TradingView NÃO recomenda pagar ou usar um script, a menos que você confie totalmente em seu autor e entenda como ele funciona. Você também pode encontrar alternativas gratuitas e de código aberto em nossos scripts da comunidade.
Instruções do autor
Learn more: rbtrading.substack.com/p/premium-tradingview-indicators-hub