OPEN-SOURCE SCRIPT
Güncellendi

Momentum Trail Oscillator [AlgoAlpha]

2 788
🟠OVERVIEW

This script builds a Momentum Trail Oscillator designed to measure directional momentum strength and dynamically track shifts in trend bias using a combination of smoothed price change calculations and adaptive trailing bands. The oscillator aims to help traders visualize when momentum is expanding or contracting and to identify transitions between bullish and bearish conditions.

🟠CONCEPTS

The core idea combines two methods. First, the script calculates a normalized momentum measure by smoothing price changes relative to their absolute values, which creates a bounded oscillator that highlights whether moves are directional or choppy. Second, it uses a trailing band mechanism inspired by volatility stops, where bands adapt to the oscillator’s volatility, adjusting the thresholds that define a shift in directional bias. This dual approach seeks to address both the magnitude and persistence of momentum, reducing false signals in ranging markets.

🟠FEATURES

The momentum calculation applies Hull Moving Averages and double EMA smoothing to price changes, producing a smooth, responsive oscillator.
anlık görüntü

The trailing bands are derived by offsetting a weighted moving average of the oscillator by a multiple of recent momentum volatility. A directional state variable tracks whether the oscillator is above or below the bands, updating when the momentum crosses these dynamic thresholds.
anlık görüntü

Overbought and oversold zones are visually marked between fixed levels (+30/+40 and -30/-40), with color fills to highlight when momentum is in extreme areas. The script plots signals on both the oscillator pane and optionally overlays markers on the main price chart for clarity.
anlık görüntü

🟠USAGE

To use the indicator, apply it to any symbol and timeframe. The “Oscillator Length” controls how sensitive the momentum line is to recent price changes—lower values react faster, higher values smooth out noise. The “Trail Multiplier” sets how far the adaptive bands sit from the oscillator mid-line, which affects how often trend state changes occur. When the momentum line rises into the upper filled area and then crosses back below +40, it signals potential overbought exhaustion. The opposite applies for the oversold zone below -40. The plotted trailing bands switch visibility depending on the current directional state: when momentum is trending up, the lower band acts as the active trailing stop, and when trending down, the upper band becomes active. Trend changes are marked with circular symbols when the direction variable flips, and optional overlay arrows appear on the price chart to highlight overbought or oversold reversals. Traders can combine these signals with their own price action or volume analysis to confirm entries or exits.
Sürüm Notları
- Switched barcolor() for plotcandle()

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.