# Momentum Expansion vs Contraction

Momentum Expansion vs Contraction is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Recasts six oscillators (MACD histogram by default) as one zero-centered histogram and labels momentum expansion versus contraction two ways: bar-to-bar streaks confirmed over 3 bars, and swing-to-swing comparison of 5-bar peaks and troughs. Connectors, markers and a lifecycle dashboard surface the read. For traders who want deceleration flagged before price bends.

- Indicator in the LuxAlgo Library, by LuxAlgo, published May 18, 2026.
- Access: free.
- Concepts: [Momentum Expansion vs Contraction](https://www.luxalgo.com/library/concept/momentum-expansion-vs-contraction/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=am676kkwl4wnyelyqv0nebx7
- Page: https://www.luxalgo.com/library/indicator/momentum-expansion-vs-contraction/

**Momentum Expansion vs Contraction** reads the grammar of [momentum expansion vs contraction](https://www.luxalgo.com/library/concept/momentum-expansion-vs-contraction/) on the oscillator of your choice: MACD histogram by default, or Momentum, Rate of Change, RSI, Stochastic %K or CCI, re-centered into one zero-based histogram. Bar-to-bar, a growing or shrinking streak must sustain for 3 confirmation bars before a phase is called; swing-to-swing, successive 5-bar peaks and troughs are compared and connected.

## How to Trade the Momentum Expansion vs Contraction?

- **Full-color columns**: each reading stretches further from zero than the last: the move is accelerating.
- **Faded columns**: readings shrinking back toward zero: deceleration; a warning, not a signal.
- **Dashed connectors**: the latest momentum peak or trough fell short of the prior one; repeated shortfalls against fresh price extremes are the raw material of divergence.
- **Phase confirmations**: expansion and contraction alerts fire only after the full confirmation window.

Neither read predicts on its own. The pane grades the move already under way.

## Momentum Expansion vs Contraction Settings

- **Oscillator** (default MACD Histogram): the tool the grammar is read on; RSI and Stochastic %K plot as distance from 50.
- **Source** (default close).
- **MACD Fast / Slow / Signal** (defaults 12 / 26 / 9): the histogram engine.
- **Oscillator Length** (default 14): lookback for the non-MACD options.
- **Confirmation Bars** (default 3): consecutive growing or shrinking bars needed to call a phase; a zero-line side change resets the count.
- **Swing Detection Length** (default 5): pivot strength of the swing read.
- **Bar Coloring** (default Bar-to-bar): each column painted by its own read, or Confirmed Phase for one color per phase.
- **Display toggles**: Swing Connectors (on), Phase Markers (off), Show Dashboard (on).

## Frequently Asked Questions

### How is this unlike the Awesome Oscillator's coloring?
The [Awesome Oscillator](https://www.luxalgo.com/library/indicator/awesome-oscillator/) colors bars by raw bar-to-bar change on one fixed oscillator. This build makes the tool selectable, demands a sustained streak before a phase is called, and adds the swing-to-swing comparison single-bar coloring cannot see.

### Is a contraction phase a reversal signal?
No. Read it as early caution that the move is losing pace, since consolidations begin the same way. Tighten management or ask for more confirmation; peaks repeatedly falling short as price makes new highs is the sharper tell.

### Which oscillator option should I pick?
The MACD histogram is the natural default: the bar-to-bar read is native to it. The grammar depends on shape, not the tool. If your charts already run RSI or CCI, pick the same engine so the panes agree.

## Related indicators

- [Oscillator Matrix](https://www.luxalgo.com/library/indicator/luxalgo-oscillator-matrix/) (Regular Bullish/bearish Divergence): markdown at https://www.luxalgo.com/library/indicator/luxalgo-oscillator-matrix.md
- [RSI Divergence: Out-of-Sample Optimizer](https://www.luxalgo.com/library/indicator/rsi-divergence-out-of-sample-optimizer/) (Regular Bullish/bearish Divergence): markdown at https://www.luxalgo.com/library/indicator/rsi-divergence-out-of-sample-optimizer.md
- [HTF Reversal Divergences](https://www.luxalgo.com/library/indicator/htf-reversal-divergences/) (Regular Bullish/bearish Divergence): markdown at https://www.luxalgo.com/library/indicator/htf-reversal-divergences.md
- [Divergence Variants & Confirmation](https://www.luxalgo.com/library/indicator/divergence-variants-and-confirmation/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/divergence-variants-and-confirmation.md
- [Hidden Divergence](https://www.luxalgo.com/library/indicator/hidden-divergence/) (Momentum & Oscillators): markdown at https://www.luxalgo.com/library/indicator/hidden-divergence.md
- [LuxAlgo - Screener (OSC)](https://www.luxalgo.com/library/indicator/luxalgo-screener-osc/) (Regular Bullish/bearish Divergence): markdown at https://www.luxalgo.com/library/indicator/luxalgo-screener-osc.md
- [RSI Candlestick Oscillator](https://www.luxalgo.com/library/indicator/rsi-candlestick-oscillator/) (Overbought/oversold): markdown at https://www.luxalgo.com/library/indicator/rsi-candlestick-oscillator.md
- [Adaptive Bounds RSI](https://www.luxalgo.com/library/indicator/adaptive-bounds-rsi/) (Overbought/oversold): markdown at https://www.luxalgo.com/library/indicator/adaptive-bounds-rsi.md

---

Source: https://www.luxalgo.com/library/indicator/momentum-expansion-vs-contraction/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
