INDICATOR MANUAL
Moving average ribbon indicatorRibbonFlux MA - Adaptive Flow [AFD] · full manual · published to TradingView
Compare up to three chart-timeframe moving averages, then use color and ribbon depth to read their relationship, spacing, and coherence without treating the display as a signal.
Start here
What the indicator does, the questions it can help answer, and its fresh-install defaults.
RibbonFlux plots independently configured Lead, Base, and optional Third moving averages. Each slot can use Open, High, Low, Close, HL2, HLC3, or OHLC4 with EMA, SMA, WMA, VWMA, HMA, RMA (Wilder), McGinley Dynamic, or a Fibonacci EMA Composite.
Lead and Base form the primary relationship. When both are valid and configured differently, the indicator can color their lines, ribbon, and optional candles by whether Lead is above or below Base. A valid, distinct Third MA adds a Base/Third shade and joins the ordered-stack and slope-coherence checks.
Adaptive ribbon dynamics use ATR(14)-normalized spacing, a 100-bar spacing percent rank, moving-average order, shared slope direction, and whether spacing is expanding. Those measurements change only fill color and opacity; they do not change any moving-average value or create an entry, exit, score, probability, or forecast.
Fresh-install defaults8 documented defaults
Swipe or scroll horizontally to see every column.
| Area | Default | Result |
|---|---|---|
| Lead MA | On · Close · EMA · 9 | Plots the faster primary average from chart-timeframe closes. |
| Base MA | On · Close · EMA · 21 | Plots the slower primary average and forms the main ribbon with Lead. |
| Third MA | Off · Close · EMA · 50 | Stores the slower context configuration but does not draw or join Flow Phases until enabled. |
| Palette and line colors | Ocean · Flow colors | Uses the Ocean relationship colors; the three stored custom colors remain inactive. |
| Line treatment | Width 2 · Solid · Balanced glow | Draws continuous Lead and Base core lines with spacing-scaled halos. |
| Flow ribbon | On · Balanced shading | Shows the Lead/Base fill when both averages are valid and distinct. |
| Ribbon dynamics | Adaptive · Balanced response | Uses a 3-bar response for slope, expansion, and smoothed display-depth changes. |
| Candle coloring | Off | Leaves the chart candles unchanged until Color bars by flow is enabled. |
How it works
How the indicator turns chart data into the states and drawings you see.
Three independent averages
Lead, Base, and Third each have their own enable switch, source, method, and length from 2 to 250. Every calculation uses the active chart timeframe; the script makes no higher-timeframe request.
Eight calculation methods
EMA, SMA, WMA, VWMA, HMA, and RMA use their standard Pine calculations. RMA (Wilder) is a price smoother, not RSI. VWMA needs usable volume. The two custom methods have additional initialization rules described below.
Fibonacci EMA Composite
For a selected length L, the method averages five EMAs whose periods are rounded L × 5/34, 8/34, 13/34, 21/34, and 34/34, with each period kept at least 1. It returns unavailable below length 8 or until every component is valid.
McGinley Dynamic
The series seeds from an SMA at its own length. Each next value adds the source-to-previous difference divided by 0.6 × length × (source/previous)⁴. Invalid source or recurrence data resets the series; it waits for a new contiguous valid seed window before drawing again.
Primary and Third relationships
Lead above Base uses the palette’s bullish relationship color; Lead below Base uses its bearish color. Equal or unavailable values are neutral. An enabled Third MA draws as a line when valid, but it affects shading and coherence only when it is distinct from both primary configurations and Lead/Base are valid.
Adaptive spacing and compression
Each ribbon leg divides its absolute MA spacing by the greater of ATR(14) and the symbol’s minimum tick. The display spacing is capped at 1, while compression uses a 100-bar percent rank of the uncapped spacing. Compression enters at or below rank 20, remains below 30, and releases at 30 or above.
Order, slopes, and expansion
Coherent flow requires Lead above Base with all participating averages rising, or Lead below Base with all participating averages falling. Quick compares 2 bars, Balanced 3, and Smooth 5. Expansion means the current ATR-normalized spacing is larger than it was that many bars ago.
Adaptive display depth
The raw depth starts at 0.35, then adds normalized spacing weighted by phase: compression adds no phase depth, mixed structure uses 0.25, coherent stable flow 0.75, and coherent expansion 1. The result is EMA-smoothed over the response length and scales only the selected ribbon opacity.
Lines, glow, fills, and candles
Solid and Stepped draw connected paths; Dotted draws one circular mark per bar and Crosses one cross per bar. Glow uses two Lead and two Base halos whose opacity scales with valid Lead/Base spacing. Optional flow candles recolor bodies, wicks, and borders; Adaptive compression uses the neutral palette color.
Output and state reference9 documented states
Swipe or scroll horizontally to see every column.
| Output or state | When it appears | Meaning |
|---|---|---|
| LEAD ABOVE BASE | Valid Lead value is greater than Base | Uses the palette’s bullish relationship color unless Adaptive compression neutralizes it. |
| LEAD BELOW BASE | Valid Lead value is less than Base | Uses the palette’s bearish relationship color unless Adaptive compression neutralizes it. |
| NEUTRAL RELATIONSHIP | Equal, unavailable, identical primary configuration, or Adaptive compression | Uses the palette’s transition color; it is not a directional call. |
| COHERENT EXPANSION | Ordered stack, aligned slopes, and wider ATR-normalized spacing | Uses the strongest Adaptive phase factor before response smoothing. |
| STABLE FLOW | Ordered stack and aligned slopes without expanding spacing | Uses a lower Adaptive phase factor than coherent expansion. |
| COMPRESSION | 100-bar spacing rank enters at 20 or below and remains below 30 | Uses neutral fill color and the minimum Adaptive phase contribution until released. |
| MIXED STRUCTURE | Valid, non-compressed averages are not ordered with aligned slopes | Uses neutral fill color and a restrained Adaptive phase factor. |
| THIRD MA SHADE | Third is enabled, valid, distinct, and the primary pair is valid | Adds a separately measured Base/Third leg; its compression state and depth are calculated independently. |
| FLOW CANDLES | Color bars by flow is on and Lead/Base are valid | Overlays fully opaque relationship-colored bodies, wicks, and borders on the chart’s OHLC. |
Settings
The 25-input reference follows the published Averages and Appearance groups. The 12 average inputs define three four-control slots; the 13 appearance inputs change presentation and Adaptive display behavior without changing the selected MA calculations.
Averages12 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Enable Lead MAshowLeadAverage | Toggle | On | — |
| Lead sourceleadSourceChoice | Choice / text | Close | Open · High · Low · Close · HL2 · HLC3 · OHLC4 | Conditional |
| Lead MA typeleadMethod | Choice / text | EMA | EMA · SMA · WMA · VWMA · HMA · RMA (Wilder) · McGinley Dynamic · Fibonacci EMA Composite | Conditional |
| Lead lengthleadLength | Whole number | 9 | Min 2 · Max 250 | Conditional |
| Enable Base MAshowBaseAverage | Toggle | On | — |
| Base sourcebaseSourceChoice | Choice / text | Close | Open · High · Low · Close · HL2 · HLC3 · OHLC4 | Conditional |
| Base MA typebaseMethod | Choice / text | EMA | EMA · SMA · WMA · VWMA · HMA · RMA (Wilder) · McGinley Dynamic · Fibonacci EMA Composite | Conditional |
| Base lengthbaseLength | Whole number | 21 | Min 2 · Max 250 | Conditional |
| Enable Third MAshowThirdAverage | Toggle | Off | — |
| Third sourcethirdSourceChoice | Choice / text | Close | Open · High · Low · Close · HL2 · HLC3 · OHLC4 | Conditional |
| Third MA typethirdMethod | Choice / text | EMA | EMA · SMA · WMA · VWMA · HMA · RMA (Wilder) · McGinley Dynamic · Fibonacci EMA Composite | Conditional |
| Third lengththirdLength | Whole number | 50 | Min 2 · Max 250 | Conditional |
Appearance13 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Palettepalette | Choice / text | Ocean | Ocean · Indigo · Ember · Mono · Forest · Gold · Violet · Orderflow · Midnight · Copper · Arctic · Carbon | Conditional |
| Line color modelineColorMode | Choice / text | Flow colors | Flow colors · Custom | Conditional |
| Custom Lead linecustomLeadLineColor | Color | RGB 40,218,210 | Conditional |
| Custom Base linecustomBaseLineColor | Color | RGB 255,82,145 | Conditional |
| Custom Third linecustomThirdLineColor | Color | RGB 255,196,80 | Conditional |
| Line widthlineWidth | Whole number | 2 | Min 1 · Max 4 | Conditional |
| Line stylelineStyleChoice | Choice / text | Solid | Solid · Stepped · Dotted · Crosses | Conditional |
| Glowglow | Choice / text | Balanced | Off · Soft · Balanced · Rich | Conditional |
| Show flow ribbonshowRibbon | Toggle | On | Conditional |
| Ribbon shadingribbonShading | Choice / text | Balanced | Off · Soft · Balanced · Rich | Conditional |
| Ribbon dynamicsribbonDynamics | Choice / text | Adaptive | Fixed · Adaptive | Conditional |
| Flow responseflowResponse | Choice / text | Balanced | Quick · Balanced · Smooth | Conditional |
| Color bars by flowcolorBars | Toggle | Off | Conditional |
Alerts and limitations
What can notify you, what can change the output, and what the indicator cannot establish.
Alerts
Limits to keep visible
- Moving averages are lagging summaries of the selected chart-timeframe source. Their order, spacing, slope, and expansion do not predict direction, persistence, or a profitable response.
- The current bar is not confirmation-gated. Its source and every enabled average can move while that bar forms, so relationship colors, adaptive depth, and optional candle colors can change intrabar.
- The published build has not been observed through a replay-and-reload comparison. This manual therefore makes no blanket non-repainting claim.
- Adaptive compression needs a 100-bar percent-rank history for each ribbon leg. Before it exists, that leg is not classified as compressed.
- VWMA depends on usable volume. On symbols or feeds without it, the selected VWMA and any relationship that requires it can remain unavailable.
- Fibonacci EMA Composite requires a selected length of at least 8 even though the shared length control permits values from 2 to 250.
- Matching Lead and Base method, length, and source disables their relationship, ribbon, and flow candles even though both lines can still be drawn. A Third configuration that duplicates either primary line can draw, but it does not add a shade or join Flow Phases.
- On Heikin Ashi and other synthetic chart types, the selected OHLC-derived sources are synthetic too. Use standard time-based candles when the intended input is the venue’s traded-price OHLC.
- Adaptive thresholds are fixed display rules, not market-state ground truth. A phase label in this manual names the code path that controls color and opacity, not a score or probability.
- The indicator is declared in front of the chart. Its lines and fills can cover candles even when optional flow candles are off; change its visual order in TradingView if you want the overlay behind price.
Troubleshooting
Start with what you see on the chart. Each answer explains the likely cause and the first setting, timeframe, or data condition to check.
Why is the ribbon missing even though I can see moving-average lines?
Start with Enable Lead MA, Enable Base MA, Show flow ribbon, and Ribbon shading. Both primary averages must be on, valid, and configured differently, Show flow ribbon must be on, and shading cannot be Off. If both slots use the same source, method, and length, change one of those three values.
Why did a Fibonacci EMA Composite line disappear?
Check that slot’s length first. The composite is deliberately unavailable below 8, even though the common length control allows 2–250. Set the length to 8 or more and allow enough bars for all five EMA components to initialize.
Why is VWMA blank while EMA works on the same chart?
VWMA requires usable volume from the symbol’s data feed. If the feed has no valid volume, that slot cannot calculate. Choose a non-volume method such as EMA or SMA, or use a symbol/feed that provides volume.
Why can I see the Third line but not its shade?
The Third line needs only a valid Third calculation. Its Base/Third shade also needs a valid, distinct Lead/Base pair, the ribbon enabled, shading above Off, and a Third configuration that does not duplicate Lead or Base. Compare all three slots’ source, method, and length.
Why does Adaptive mode not show compression near the start of the chart?
Compression uses a 100-bar percent rank of ATR-normalized spacing. Until that history exists, the script treats compression as unavailable rather than guessing. Load more history or wait for the window to fill; changing Flow response does not shorten the 100-bar rank window.
Why do the ribbon or candles still use palette colors in Custom line mode?
Custom fixes the enabled MA line and halo colors. The Lead/Base ribbon and optional candles still describe the Lead/Base relationship with the selected palette. The Third custom color also supplies the Base/Third shade when that leg is valid.
Why do Dotted or Crosses look farther apart when I zoom in?
Those styles draw one mark per chart bar; Dotted uses circular marks rather than a dashed path. Their visual spacing therefore follows bar width. Zoom out for a denser row of marks, or choose Solid or Stepped for a connected path.
Why did the flow color or opacity change before the candle closed?
RibbonFlux updates from the forming chart bar and does not wait for bar confirmation. The selected sources, averages, slopes, spacing, and relationship can all change intrabar. Review the state after the bar closes if your process requires a completed-bar reading.
Why can’t I create a RibbonFlux alert condition?
The published script contains no fixed alertcondition() entries and no dynamic alert() calls. There is no event surface to select. Use the overlay visually; do not assume a color or phase has a hidden alert equivalent.