RibbonFlux MA - Adaptive Flow [AFD]
Your averages are stacked and pointing the same way - but is that move widening, just holding, or already compressing?
Every MA ribbon on the shelf draws the same two or three lines and floods the gap with one colour at one opacity. So a ribbon that has pulled four ATR apart and is still separating looks exactly like a ribbon that has collapsed onto itself. The fill never tells you anything the lines didn't, which is why most people end up reading the lines and ignoring the shading entirely.
RibbonFlux makes the space between the lines carry the information. The gap is measured against ATR, ranked against its own recent history, and the shading answers to that: it deepens while the legs separate in agreement, and drains to a restrained neutral the moment they compress or lose their order. Same averages you already read - the space between them now states which of four conditions it is in.
WHY IT MATTERS
Separation and compression are the two things an MA ribbon actually knows, and the standard ribbon throws both away by drawing them identically. RibbonFlux spends its whole visual budget on that one distinction. It describes geometry already on your chart - never a prediction of what comes next, and never an instruction to act.
AT A GLANCE
Three independent averages - Lead, Base, and an optional Third. Each picks its own method, length (2-250) and price source, and a single enabled average still draws on its own.
Eight methods per slot - EMA, SMA, WMA, VWMA, HMA, RMA (Wilder), McGinley Dynamic, Fibonacci EMA Composite. Mixed freely: an HMA Lead over an EMA Base over an RMA Third is a valid setup.
Seven price sources per slot - Open, High, Low, Close, HL2, HLC3, OHLC4. Set per average rather than globally, and always on the chart timeframe.
The Flow Phase Engine - four conditions drive the fill's colour and depth: coherent expansion, stable flow, compression, mixed structure. Display only, and they never touch the MA values.
Each leg measured separately - Lead/Base and Base/Third are scored independently, so one fill can be compressing while the other expands. A single-opacity ribbon cannot show that.
Twelve palettes - Ocean, Indigo, Ember, Mono, Forest, Gold, Violet, Orderflow, Midnight, Copper, Arctic, Carbon. Or set Line color mode to Custom for a fixed colour per average, independent of the flow.
Line width and line style - 1 to 4 pixels, and Solid, Stepped, Dotted or Crosses. Applied to every core line and both halo tiers together, so the whole system thins or thickens as one.
Optional flow candles - bodies, wicks and borders take the relationship colour. Off by default, and under Adaptive dynamics they turn neutral during compression along with the ribbon.
Deliberately quiet - seven plots, two fills, one optional candle overlay. No alerts, no arrows, no dashboard, no labels, no boxes, no trendlines, nothing else drawn.
THE FOUR FLOW PHASES
Each leg of the ribbon is classified on every bar, and its own fill responds. Nothing here produces an event, and no phase ranks, scores or grades the market.
Coherent expansion - the enabled averages are in order, sloping the same way, and that leg is widening. Deepest shading: the phase factor is 1.00.
Stable flow - in order and sloping together, but the leg is not widening. Held back at 0.75.
Compression - the leg's ATR-normalized spacing sits in the bottom fifth of its own last 100 bars. Restrained neutral colour, and a phase factor of 0.00, which leaves depth at its 0.35 floor.
Mixed structure - the ordering or the slope agreement has broken. Restrained neutral colour, minimal shading at 0.25.
Compression uses a deadband, not a single threshold: a leg enters compression at a percent rank of 20 or below and only leaves it at 30 or above, so a leg hovering near one number does not flicker between two appearances. Before 100 bars of history exist, no leg is classified as compressed.
THE MECHANICS, STATED PLAINLY
ATR spacing = abs(faster average - slower average) / max(ATR(14), one tick)
leg depth = 0.35 + 0.65 x clamp(ATR spacing, 0, 1) x phase factor, then EMA-smoothed over the Flow response length
compression: enter at percent rank <= 20 over 100 bars, leave at >= 30
ordered: Lead > Base (> Third), or Lead < Base (< Third)
Flow response sets one number used three ways - the slope lookback, the expansion lookback, and the smoothing length: Quick is 2 bars, Balanced 3, Smooth 5. Setting Ribbon dynamics to Fixed bypasses the engine and holds each fill at the opacity you selected.
HOW IT DIFFERS FROM A STANDARD MA RIBBON
The fill is measured, not decorative - opacity is a function of ATR-normalized spacing and phase, recomputed every bar. A conventional ribbon fills the gap at a constant tone however wide or narrow it is.
Both legs are scored on their own terms - the Lead/Base fill and the Base/Third fill can disagree, so compression in the inner leg does not mute the outer one, or the reverse.
Compression is relative to the instrument, and sticky - a percent rank of its own history with a 20/30 deadband, not a fixed price or tick distance. It travels across symbols and timeframes without retuning.
Two methods a ribbon rarely offers - McGinley Dynamic and a Fibonacci EMA Composite. The composite is the equal-weight mean of five EMAs at Fibonacci-scaled periods; McGinley scales its own step by the fourth power of the price ratio.
The arithmetic ships with an independent open-source reference implementation - every documented formula is reproducible rather than asserted. A trust signal, not the pitch: what you are here for is the ribbon, not the tests.
THE VISUALS
Lead and Base - a crisp core line plus two restrained halo tiers each. At the default width of 2 the Lead halos are 6 and 4 pixels and the Base halos 5 and 3; Line width scales all of it together.
Glow - Off, Soft, Balanced, Rich, with opacity following Lead/Base spacing independently of the ribbon. So the lines themselves brighten as the pair separates, with a floor so they never vanish.
Ribbon shading - Off, Soft, Balanced, Rich sets the maximum depth the Flow Phases then modulate. Off removes both fills and leaves the lines.
A valid Third MA - one crisp line plus its own Base-to-Third shade. It also joins the ordering and slope tests, so enabling it makes coherence a three-line condition.
Line style - Stepped holds each value until the next bar. Dotted and Crosses place one mark per bar, so spacing follows bar width and opens up as you zoom in. Pine's plot() has no stroked dotted or dashed line, and this script uses no drawing objects to fake one.
Layering - the lines and fills draw in front of the candles, not behind them. Deliberate, so the optional flow candles can colour wicks and borders as well as bodies; if it reads heavy, Line width 1 or Glow Soft thins it.
HOW TO USE IT
Start with the defaults - Close EMA 9 over Close EMA 21, Ocean, Balanced glow and shading, Adaptive dynamics. Chosen for readability, not tuned as trading parameters.
Enable the Third MA for slower context - it defaults to Close EMA 50. Ordering then requires all three in sequence, a stricter condition than two.
Reach for Flow response first - Quick if the shading feels sluggish, Smooth if it feels twitchy. It is the one control that changes how fast the appearance reacts.
Set Ribbon dynamics to Fixed to switch the engine off - a plain constant-opacity ribbon, for comparing against what you ran before. Everything else, from palette to custom colours to width, style, glow and candle colouring, is taste: set it once and leave it.
WHAT IT DELIBERATELY DOES NOT DO
It issues no alerts and has no alert conditions at all. It draws no arrows, entries, retests, setup zones, targets or labels, keeps no dashboard or readout, and ranks, scores and grades nothing. It makes no accuracy, reliability, profitability, probability or future-result claim of any kind. Moving averages are lagging transformations of price that has already printed: visible separation, alignment or colour establishes neither future direction nor the quality of any trade. Educational chart context only - not financial advice.
DATA, TIMEFRAMES, AND WHAT TO CHECK YOURSELF
Everything is computed on your chart's own timeframe and data - there are no higher-timeframe requests anywhere in the source, so there is no lookahead argument to disclose and no second feed to reconcile against your chart.
Any MA moves while its bar is still forming , and two parts of this script also carry state from bar to bar: the McGinley recursion and the compression deadband. That describes the mechanism. Confirm it with the bar-replay tool on your own symbol and timeframe before relying on it - a description of mechanism is not that check, and nothing here claims to be.
The averages read chart OHLC - on Heikin Ashi, Renko, Range or similar they average those synthetic values, not traded prices. Use standard time-based candles if you want the averages to describe real prices.
VWMA needs usable volume, and the Fibonacci EMA Composite needs a length of 8 or more - each is simply unavailable otherwise. A selected calculation that cannot be produced stays unavailable: the script never silently substitutes another method.
McGinley seeds from an SMA of its own length, then advances by previous + (source - previous) / (0.6 x length x ratio^4). If its source or recurrence goes invalid the line goes unavailable and reseeds only after the next contiguous valid window.
Identical Lead and Base settings leave nothing to read - both lines still draw, but the ribbon and flow candles switch off and the lines fall back to neutral. A Third duplicating Lead or Base likewise draws its line while taking no shade and no phase depth.
ORIGINALITY AND CREDIT
Ribbon indicators are old ground; what is new here is that the fill is a measurement rather than a decoration - ATR-normalized leg spacing, a relative compression rank with hysteresis, and per-leg depth, all resolved into colour and opacity and nothing else. The engine is deliberately confined to display, and the surface is deliberately small.
Open source under the Mozilla Public License 2.0. (c) Auction Foundry LLC.
This indicator describes the geometry of averages computed from your chart's own price history. It is not a forecast, not a signal, and not financial advice.
Indicator









