OPEN-SOURCE SCRIPT

Lumina Adaptive Momentum Oscillator [Pineify]

471
Lumina Adaptive Momentum Oscillator

This oscillator measures price momentum through a double-smoothed triangular moving average, then overlays a Kaufman-style Adaptive Moving Average as a signal line that accelerates in trending conditions and slows in ranging ones. The result is a histogram that stays cleaner than a simple ROC or MACD while still catching real directional shifts — buy and sell signals fire only when momentum crosses the adaptive signal while on the "wrong" side of zero, filtering out crosses that occur mid-trend.

Key Features

  • Triangular MA momentum — double SMA smoothing cuts through noise that a single-period momentum calculation amplifies
  • Kaufman Adaptive Moving Average signal line — efficiency-ratio scaling means the signal line tracks fast when price has clear direction and lags conservatively during chop
  • Polarity-colored histogram — bars flip between bull and bear colors on the zero line, making directional bias readable at a glance
  • Counter-trend signal filter — buy signals require momentum to be below zero; sell signals require it above, so the oscillator only flags reversals, not trend continuation pulses
  • Configurable alerts for buy and sell conditions (uncomment the alertcondition lines to enable)


How It Works

  1. Triangular momentum: A triangular moving average is the SMA of an SMA — ta.sma(ta.sma(close, length), length). This double pass heavily weights the middle of the lookback window, producing a line that barely reacts to individual candle spikes. Momentum is then the change in this average over length bars, equivalent to asking: "how much has the ultra-smooth baseline shifted over the period?"
  2. Adaptive signal line (AMA): The signal applies a Kaufman Adaptive Moving Average to the momentum values. Each bar, an Efficiency Ratio is computed as the absolute cumulative price change divided by the sum of bar-by-bar absolute changes over the window. A high ER (price moving steadily in one direction) produces a fast smoothing constant; a low ER (lots of back-and-forth) produces a slow one. The smoothing constant is squared before application — squaring compresses near-zero values toward zero and pushes higher values closer to one, amplifying the contrast between ranging and trending states.
  3. Signals: A buy condition fires when the momentum histogram crosses above the signal line from below zero. A sell condition fires when momentum crosses below the signal line from above zero. Both plotshape and alertcondition calls are included but commented out by default, so the chart stays clean unless signals are explicitly enabled.


How the Components Work Together

The triangular MA reduces the raw momentum noise that trips up standard crossover strategies. A plain ta.change(close, length) signal line would fire constantly in sideways markets because individual candle closes swing around. By first anchoring momentum to a doubly-smoothed baseline, the histogram only moves when an actual directional shift is underway in price.

The AMA signal line then adapts to how directional that momentum itself is. When momentum is trending (e.g., steadily falling through a corrective move), the AMA tracks it closely, keeping the histogram-to-signal gap narrow and the crossover conditions quiet. When momentum flips abruptly — the scenario a reversal trader wants — the ER spikes, the smoothing constant rises, and the signal line catches up quickly enough to generate a timely cross.

The zero-side filter adds the final constraint: only counter-trend crosses matter. A bullish cross above zero would typically mean momentum is already positive and the trend is continuing, not reversing — those are excluded. This makes the signals less frequent but more aligned with actual turning points.

Trading Ideas and Insights

  • Use on the daily or 4H chart during confirmed trending markets. Wait for pullbacks that drive momentum negative, then watch for a histogram-crosses-signal event below zero as an early re-entry cue. Confirmation from price action (e.g., a higher low or a break of the short-term descending channel) reduces false positives.
  • On intraday charts, the double smoothing introduces noticeable lag — roughly 2× the period in bars. For a 14-bar setting this means signals may appear 3-5 candles after the actual reversal candle. Consider reducing length to 7-9 on lower timeframes to recover responsiveness.
  • The signal line (currently commented out) can be uncommented as an additional visual layer. When the histogram bars are shrinking toward zero while the signal line is still diverging, it often indicates momentum exhaustion before the actual cross occurs, giving a heads-up for limit orders.


Unique Aspects

  • Most MACD-style oscillators apply EMA smoothing to raw price; this one applies double-SMA smoothing before differencing, which produces a different noise profile — more immune to single-bar wicks but slower to react to sharp moves
  • Applying the Kaufman AMA to momentum values (rather than price) is less common. The efficiency ratio reflects momentum's own trendiness, not price's, so the adaptive behavior is tuned to the oscillator's dynamic rather than borrowed from a price-following MA
  • The zero-side signal filter is built in rather than left to the trader to configure — the indicator makes an explicit methodological choice that these signals represent reversals only


How to Use

  1. Add the indicator to any chart. The default length of 14 suits daily and 4H charts; adjust lower for faster timeframes.
  2. Watch the histogram color: sustained green bars above zero indicate positive momentum; sustained red bars below zero indicate negative momentum.
  3. For signals: uncomment the two plotshape lines in the source to display BUY/SELL labels, or uncomment the alertcondition lines and create alerts via TradingView's alert panel.
  4. A BUY label appears when the histogram crosses above the signal line while below zero — a potential momentum reversal from bearish territory.
  5. A SELL label appears when the histogram crosses below the signal line while above zero — a potential momentum reversal from bullish territory.
  6. Combine with a higher-timeframe trend filter (e.g., price above/below a 200 EMA) to take only signals aligned with the prevailing trend.


Customization

  • Data Length (default: 14) — Controls the period for both the triangular MA and the adaptive signal line. Higher values produce smoother output with more lag; lower values react faster but generate more noise. Typical range: 7–21.
  • Bullish Color (default: green) — Color of histogram bars when momentum is positive.
  • Bearish Color (default: red) — Color of histogram bars when momentum is negative.


Conclusion

The Lumina Adaptive Momentum Oscillator combines triangular-MA momentum with a Kaufman-adaptive signal line to surface genuine reversal pressure rather than routine oscillations. The built-in zero-side signal filter keeps the indicator focused on counter-trend setups, making it most useful as a timing tool within a larger trend-following framework. Past patterns do not guarantee future results — use alongside price structure and volume confirmation.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。