OPEN-SOURCE SCRIPT

Momentum Vol Composite Pro [JOAT]

3 002
MOMENTUM VOL COMPOSITE PRO [JOAT]

A four-factor composite oscillator that fuses momentum, volatility, volume-flow, and trend into a single Z-normalised line — then exposes per-factor weights, divergence detection, an ASCII gauge dashboard, and a slope-coloured composite MA. Built on the idea that no single oscillator tells you what the market is doing — but four orthogonal ones, properly normalised and weighted, can.

istantanea

The four factors

Each factor is Z-normalised (subtract its own rolling mean, divide by its own rolling stdev) before being blended, so they all live on the same scale and a weight of "0.25" actually means "one-quarter share of the composite" regardless of the instrument:

  • ROC (Rate-of-Change) — the price-velocity factor. Captures pure directional momentum.
  • ATR (volatility) — the range-expansion factor. Rises when bars are getting larger; useful as a "the market is committing" signal.
  • Volume Flow — cumulative volume minus its own EMA. A proxy for net accumulation/distribution that is regime-aware (it normalises around its own trend).
  • EMA Difference — short EMA minus long EMA, the classic MACD-style trend factor.


The four Z-scores are weighted (sliders 0–4 each, default 0.25 each), sum-normalised internally so any positive configuration is valid, and combined into a single composite Z-line. An EMA smoother on top of the composite produces the slope-coloured Composite MA that drives Buy/Sell flips.

This is what "composite" should mean — orthogonal factors, weighted, on a common scale, with the weights exposed so the trader controls the personality.

Why per-factor weights matter

Default 0.25 / 0.25 / 0.25 / 0.25 reproduces the textbook equal-weight composite. But equal weights are an assumption, not a fact. If your instrument is volume-driven, raise VolFlow Weight. If your timeframe is dominated by trend, raise EMA Diff Weight. If you are scalping a noisy intraday environment, drop ROC Weight in favour of VolFlow. The composite reshapes itself live as you slide.

Signal engine

A Buy signal fires when the composite MA slopes up; a Sell fires when it slopes down. The composite line itself crosses the configurable threshold guides (default ±1 Z) to mark "extreme bull" and "extreme bear" states. A separate alert fires when |composite| crosses the Extreme threshold (default 2.0 Z) — the script's strongest read.

Divergence engine (JOAT enhancement)

A slope-comparison divergence runs in parallel: it compares the slope of the composite against the slope of price over a configurable lookback. Both slopes must exceed an epsilon to filter out flat-region noise, and a divergence cooldown spaces them out. Divergence labels can be forced onto the main chart pane via force_overlay so you can see them without flipping to the oscillator pane.

Histogram background

Faint columns plot the raw composite value behind the line — this is useful as a "before the slope flips" early read. You can see exhaustion building in the histogram before the slope-coloured MA actually turns.

ASCII gauge dashboard (JOAT enhancement)

A monospaced dashboard with a unique feature — each per-factor row shows both the numeric Z-value and an ASCII bar gauge ("|||||----" style) that renders the value visually inside the table cell. The gauge maps Z in the range [−2, +2] linearly across N glyphs (configurable width), with a separator at the centre. At a glance you can see which factors are dominating without reading the numbers.

Dashboard rows:

  • Composite Z + bar gauge + status (extreme bull / bull / neutral / bear / extreme bear).
  • ROC Z + gauge.
  • ATR Z + gauge.
  • VolFlow Z + gauge.
  • EMA Diff Z + gauge.
  • Composite MA slope (Rising / Falling / Flat).
  • Last signal direction with bar age.
  • Divergence status with cooldown remaining.


istantanea

Visual system

  • Slope-coloured composite MA (bull / bear by slope sign, configurable width).
  • Translucent composite line for context (transparency configurable, default matches the v5 source).
  • Threshold guide lines at ±1, zero line, and faint background histogram for exhaustion-before-flip reads.
  • Buy / Sell labels can be force-overlaid onto the main chart pane if desired.


A locked Emerald-Night palette (vivid green bull / vivid red bear / sage neutral on a midnight-forest ground) gives the pane a distinct identity.

Alerts

Five alert conditions:

  • Composite crossover above high threshold (default +1)
  • Composite crossunder below low threshold (default −1)
  • |Composite| crosses Extreme |Z| (default 2.0)
  • Bullish divergence detected
  • Bearish divergence detected


How to read it

Three reads, in order of conviction:

  1. ASCII gauge agreement — when all four factor gauges point the same way, the composite is a high-conviction read. When they disagree, the composite is a wash.
  2. Composite MA slope — once the smoothed line slope flips and price agrees, you have a clean signal.
  3. Divergence + extreme |Z| — the rarest and strongest read. A divergence at a composite extreme tells you that one of the factors is rolling over while price is not, which is the textbook reversal setup.


The histogram is the leading indicator on the line — when it starts shrinking while price is still extending, the slope is about to flip.

Suggested settings

Defaults (ROC 14, ATR 14, VolFlow 20, ShortEMA 12, LongEMA 26) reproduce the classical configuration. For lower timeframes drop all lengths roughly proportionally. The per-factor weights are where the personality lives: pure trend-following bias → raise EMA Diff to 1.5, drop ATR to 0.1. Pure volatility-of-momentum bias → raise ROC and ATR, drop VolFlow.

Originality / what's reused

The factor primitives (ROC, ATR, EMA difference, cumulative volume flow) are public-domain. The Z-normalisation pipeline that puts them on a common scale, the sum-normalised per-factor weighting, the ASCII bar-gauge dashboard, the histogram-behind-line exhaustion view, the slope-coloured composite MA, and the divergence engine with epsilon filter are all JOAT-original and tuned together as a single oscillator. No third-party code reused.

Open source

Published open-source under the default Mozilla Public License 2.0. Sectioned source, tooltips on every input, helper functions documented inline. Each factor's Z-normalisation, the weighting pipeline, the gauge renderer, and the divergence detector are isolated modules — adapt any single one without reading the whole file.

Limitations

The composite is statistical in nature — it tells you how stretched the blend is, not which specific factor is driving the read. That is what the per-factor rows are for. The Z-normalisation needs enough history to be meaningful; on a fresh chart with little data the composite warms up to flat. Divergences are non-repainting but carry the natural lag of slope-over-window comparison.

—

-made with passion by jackofalltrades

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.