OPEN-SOURCE SCRIPT
OHLC4 Structure Ribbon [RMA]

OHLC4 Structure Ribbon [RMA] is a multi-horizon market-structure indicator built from a fixed stack of Wilder Running Moving Averages applied to OHLC4. Rather than treating the ribbon as a collection of independent moving averages, the indicator analyzes the shape, ordering, compression, expansion, and directional geometry of the entire stack as one structural system.
The primary ribbon uses six RMA horizons: 5, 8, 13, 20, 34, and 50. A separate 75 / 110 pair provides a slower structural reference without influencing the primary ribbon's regime engine.
The objective is not simply to show whether a fast average is above or below a slow average. The ribbon is designed to answer a broader question: how organized is price structure across multiple horizons, how strong is that structure relative to current volatility, and is that structure being maintained, disrupted, or transferred to the opposite side?
Why OHLC4 and RMA?
Each average is calculated from OHLC4, giving equal representation to the open, high, low, and close of each candle rather than using the closing price alone. The smoothing method is Wilder's RMA, which reacts differently from a conventional EMA. RMA places more persistence into the series, allowing the ribbon to develop a slower, more structural character while still preserving enough responsiveness for shorter-timeframe use.
Because the six averages span several horizons, the resulting ribbon provides a continuous view from the fast edge of the market through the deeper intermediate structure.
➖REG BODY➖
At the center of the indicator is a measurement called REG BODY. Instead of measuring only the distance between two selected averages, REG BODY examines all six RMA levels together. Each RMA is assigned its theoretical Wilder lag, and a linear regression is calculated across those lag coordinates. That regression estimates the directional slope of the entire stack. The slope is then projected across the complete lag range to produce one signed structural spread.
A positive REG BODY means the faster horizons are structurally positioned above the slower horizons. A negative REG BODY means the opposite. The larger the absolute value, the more strongly the full ribbon is separating in that direction. This is important because two ribbons can have the same fast-to-slow distance while having very different internal structure. One may be cleanly ordered from front to back, while another may be folded, crossed, or compressed internally. REG BODY is intended to evaluate the complete structure rather than relying on a single moving-average spread.
➖Volatility normalization➖
Raw ribbon separation naturally varies by instrument, price level, and timeframe. To make the structural measurement more comparable, REG BODY is normalized by ATR14. This expresses ribbon expansion in volatility-relative terms rather than raw points. For example, a ten-point separation means something very different on an instrument whose ATR is 3 than on one whose ATR is 100. ATR normalization gives the engine a common structural language across those environments.
➖Peak-Persistence ATR-Drag Guard➖
Strong trends can occasionally create an unusual problem: volatility expands so rapidly that ATR rises faster than the ribbon itself. When that happens, a simple REG BODY / ATR calculation can make a structurally healthy trend appear to weaken even while the ribbon remains strongly ordered and continues expanding. The indicator addresses this with a Soft Peak-Persistence ATR-Drag Guard. The guard evaluates ribbon ordering, REG BODY persistence, directional continuity, and ATR expansion together. When the underlying structure remains intact, it can temporarily preserve part of the previously established normalized strength rather than allowing an abrupt ATR expansion to collapse the reading prematurely. The effect is intentionally limited. It decays automatically and releases when structure deteriorates, the ribbon body cools, directional ownership changes, or the qualifying conditions are no longer present. Its purpose is not to manufacture momentum. It is simply to reduce false structural decay caused by volatility expanding faster than an otherwise intact ribbon.
➖Wide Semantic and the CORE scale➖
After volatility normalization and the persistence guard, structural strength is translated through a non-linear mapping called Wide Semantic. Wide Semantic converts the normalized ribbon measurement into a bounded -100 to +100 CORE scale. The center of the scale provides greater resolution for ordinary market structure, while increasingly large structural expansions require progressively greater ATR-normalized separation to approach the extremes.
The principal absolute-value anchors are:
0.70 ATR → 34
1.25 ATR → 55
2.50 ATR → 65
4.00 ATR → 75
7.00 ATR → 89
12.0 ATR → 95
20.0 ATR → 100
Positive CORE values represent bullish structural direction, while negative values represent bearish direction. A CORE reading is not a probability, price target, or percentage. It is a volatility-normalized measurement of multi-horizon structural strength. This distinction becomes especially useful near the outer portions of the scale. A move from 89 to 95 represents a much larger increase in underlying structural expansion than a move from 34 to 55.
➖Global Regime architecture➖
The ribbon uses CORE together with the physical ordering of the RMA stack to maintain a persistent Global Regime. A fully ordered bullish stack can establish Bull Rise, while a fully reversed stack can establish Bear Fall. When an established bullish structure begins to lose internal ordering, the system can transition into Bull Resistance rather than immediately declaring the market bearish. Likewise, disrupted bearish structure can remain in Bear Support while the prior bearish lineage is still structurally relevant. This distinction allows the indicator to separate trend continuation, compression, transition, and actual directional transfer. Directional ownership uses fixed structural rails. Same-side full-stack re-entry occurs around ±34, while initial or opposite-side directional transfer requires approximately ±55. Larger structural expansions can progress into Extreme and Exceptional regimes around ±89 and ±95, with separate release thresholds to reduce unnecessary state flipping. The result is deliberately different from coloring a ribbon solely according to whether one moving average crossed another.
➖Contiguous ribbon transitions➖
The visible ribbon contains five adjacent bands:
5/8 → 8/13 → 13/20 → 20/34 → 34/50
Transition ownership begins at the fast 5/8 edge and progresses outward. A deeper portion of the ribbon is not allowed to visually transfer direction until the faster pairs in front of it have aligned first. This creates a contiguous transition rather than allowing isolated sections of the ribbon to change color independently. During a bullish rollover, for example, the fast edge can begin transferring into resistance while slower portions of the ribbon still retain bullish ownership. The reverse occurs during recovery from bearish structure. This makes the ribbon itself a visual representation of how far a structural transition has propagated through the stack.
➖Ribbon ORDER➖
The context table also displays Ribbon ORDER %. ORDER measures how efficiently the six averages form one monotonic path from OHLC5 through OHLC50. A perfectly ordered ribbon approaches 100%, while internal folding and crossover geometry progressively reduce the reading. The accompanying Bull/Bear x/5 value shows how many adjacent pairs have aligned contiguously from the fast edge. For example, Bull 3/5 means the first three adjacent relationships have transferred bullishly while the deeper structure has not yet completed the transition. ORDER describes the ribbon's current geometry. It does not override Global Regime ownership.
➖Developing higher-timeframe CORE➖
The table includes both the current chart-timeframe CORE and a Developing HTF CORE calculated on the automatically selected next higher timeframe. The higher-timeframe value is not created by resampling the chart-timeframe result. The complete six-RMA structural engine is calculated natively in the higher-timeframe context using the same REG BODY, ATR normalization, persistence guard, and Wide Semantic mapping. Because this is a developing higher-timeframe reading, it updates while the higher-timeframe candle is still forming. It can therefore change until that candle closes. This provides a direct comparison between current-timeframe structure and the developing structural condition immediately above it.
➖75 / 110 long structure➖
OHLC75 and OHLC110 form a separate slower structural pair. They do not participate in REG BODY, CORE, or Global Regime calculations. Their purpose is to provide a longer structural reference alongside the primary six-average ribbon. When 75 > 110, the long structure is displayed in orange. When 110 > 75, it is displayed in gray. The table also reports the current relationship directly—for example, 75 > 110—along with the number of bars since the most recent 75/110 crossover.
➖Price-relative OHLC labels➖
Each RMA level can be displayed in a right-side label containing the current level and its distance from price. The labels also maintain a persistent price-relative marker:
$⤴ means price most recently moved above that OHLC level.
$⤵ means price most recently moved below that OHLC level.
The marker persists until the opposite side takes ownership. This makes it possible to scan the right-side stack and quickly see where current price is positioned relative to multiple structural horizons. The short-horizon labels visually inherit the active ribbon gradient, while the 75/110 labels use their separate long-structure color owner.
➖Crossover events➖
Five crossover families are available. The 5/8 event represents the fast ribbon edge. 8/20 provides an optional early-intermediate structural crossover, while 13/34 represents a deeper middle-structure transition. 20/50 tracks slower primary-ribbon equilibrium, and 75/110 represents the separate long structural pair. Bullish crossover labels appear below the candle and bearish labels appear above it. Historical events preserve the exact Global Regime color that was active when the crossover occurred, allowing older events to retain their original structural context rather than being recolored by the current regime.
➖PlotCandles➖
Optional PlotCandles can color price directly from the active Global Regime while maintaining independent body, wick, and border transparency.
➖How I use the ribbon➖
The indicator is most useful when the components are read together rather than treating any one color or crossover as a standalone signal.
A clean, high-ORDER ribbon with expanding CORE reflects a very different structural environment from a similarly colored ribbon whose ORDER is deteriorating and whose fast-edge transition has already begun. When CORE is higher than its HTF value, tha'ts also a bullish sign (and vice versa). Likewise, disagreement between chart CORE and Developing HTF CORE can provide useful context. Strong local structure may be developing inside a weaker higher-timeframe environment, or a lower-timeframe transition may be occurring while the next timeframe remains firmly established.
The 75/110 pair provides another layer of context without contaminating the primary regime calculation. For that reason, I view the indicator primarily as a market-structure and context tool, rather than a mechanical entry/exit system.
➖Final note➖
Moving averages are inherently derived from historical price, and no ribbon can predict future market direction. CORE, ORDER, Global Regime states, crossover events, and Developing HTF readings should be interpreted as descriptions of current and developing structure—not guarantees of continuation or reversal.
The value of the indicator is in combining multi-horizon OHLC4 structure, volatility-normalized strength, persistent regime ownership, and visually progressive ribbon transitions into one coherent framework.
➖A few chart examples➖






The primary ribbon uses six RMA horizons: 5, 8, 13, 20, 34, and 50. A separate 75 / 110 pair provides a slower structural reference without influencing the primary ribbon's regime engine.
The objective is not simply to show whether a fast average is above or below a slow average. The ribbon is designed to answer a broader question: how organized is price structure across multiple horizons, how strong is that structure relative to current volatility, and is that structure being maintained, disrupted, or transferred to the opposite side?
Why OHLC4 and RMA?
Each average is calculated from OHLC4, giving equal representation to the open, high, low, and close of each candle rather than using the closing price alone. The smoothing method is Wilder's RMA, which reacts differently from a conventional EMA. RMA places more persistence into the series, allowing the ribbon to develop a slower, more structural character while still preserving enough responsiveness for shorter-timeframe use.
Because the six averages span several horizons, the resulting ribbon provides a continuous view from the fast edge of the market through the deeper intermediate structure.
➖REG BODY➖
At the center of the indicator is a measurement called REG BODY. Instead of measuring only the distance between two selected averages, REG BODY examines all six RMA levels together. Each RMA is assigned its theoretical Wilder lag, and a linear regression is calculated across those lag coordinates. That regression estimates the directional slope of the entire stack. The slope is then projected across the complete lag range to produce one signed structural spread.
A positive REG BODY means the faster horizons are structurally positioned above the slower horizons. A negative REG BODY means the opposite. The larger the absolute value, the more strongly the full ribbon is separating in that direction. This is important because two ribbons can have the same fast-to-slow distance while having very different internal structure. One may be cleanly ordered from front to back, while another may be folded, crossed, or compressed internally. REG BODY is intended to evaluate the complete structure rather than relying on a single moving-average spread.
➖Volatility normalization➖
Raw ribbon separation naturally varies by instrument, price level, and timeframe. To make the structural measurement more comparable, REG BODY is normalized by ATR14. This expresses ribbon expansion in volatility-relative terms rather than raw points. For example, a ten-point separation means something very different on an instrument whose ATR is 3 than on one whose ATR is 100. ATR normalization gives the engine a common structural language across those environments.
➖Peak-Persistence ATR-Drag Guard➖
Strong trends can occasionally create an unusual problem: volatility expands so rapidly that ATR rises faster than the ribbon itself. When that happens, a simple REG BODY / ATR calculation can make a structurally healthy trend appear to weaken even while the ribbon remains strongly ordered and continues expanding. The indicator addresses this with a Soft Peak-Persistence ATR-Drag Guard. The guard evaluates ribbon ordering, REG BODY persistence, directional continuity, and ATR expansion together. When the underlying structure remains intact, it can temporarily preserve part of the previously established normalized strength rather than allowing an abrupt ATR expansion to collapse the reading prematurely. The effect is intentionally limited. It decays automatically and releases when structure deteriorates, the ribbon body cools, directional ownership changes, or the qualifying conditions are no longer present. Its purpose is not to manufacture momentum. It is simply to reduce false structural decay caused by volatility expanding faster than an otherwise intact ribbon.
➖Wide Semantic and the CORE scale➖
After volatility normalization and the persistence guard, structural strength is translated through a non-linear mapping called Wide Semantic. Wide Semantic converts the normalized ribbon measurement into a bounded -100 to +100 CORE scale. The center of the scale provides greater resolution for ordinary market structure, while increasingly large structural expansions require progressively greater ATR-normalized separation to approach the extremes.
The principal absolute-value anchors are:
0.70 ATR → 34
1.25 ATR → 55
2.50 ATR → 65
4.00 ATR → 75
7.00 ATR → 89
12.0 ATR → 95
20.0 ATR → 100
Positive CORE values represent bullish structural direction, while negative values represent bearish direction. A CORE reading is not a probability, price target, or percentage. It is a volatility-normalized measurement of multi-horizon structural strength. This distinction becomes especially useful near the outer portions of the scale. A move from 89 to 95 represents a much larger increase in underlying structural expansion than a move from 34 to 55.
➖Global Regime architecture➖
The ribbon uses CORE together with the physical ordering of the RMA stack to maintain a persistent Global Regime. A fully ordered bullish stack can establish Bull Rise, while a fully reversed stack can establish Bear Fall. When an established bullish structure begins to lose internal ordering, the system can transition into Bull Resistance rather than immediately declaring the market bearish. Likewise, disrupted bearish structure can remain in Bear Support while the prior bearish lineage is still structurally relevant. This distinction allows the indicator to separate trend continuation, compression, transition, and actual directional transfer. Directional ownership uses fixed structural rails. Same-side full-stack re-entry occurs around ±34, while initial or opposite-side directional transfer requires approximately ±55. Larger structural expansions can progress into Extreme and Exceptional regimes around ±89 and ±95, with separate release thresholds to reduce unnecessary state flipping. The result is deliberately different from coloring a ribbon solely according to whether one moving average crossed another.
➖Contiguous ribbon transitions➖
The visible ribbon contains five adjacent bands:
5/8 → 8/13 → 13/20 → 20/34 → 34/50
Transition ownership begins at the fast 5/8 edge and progresses outward. A deeper portion of the ribbon is not allowed to visually transfer direction until the faster pairs in front of it have aligned first. This creates a contiguous transition rather than allowing isolated sections of the ribbon to change color independently. During a bullish rollover, for example, the fast edge can begin transferring into resistance while slower portions of the ribbon still retain bullish ownership. The reverse occurs during recovery from bearish structure. This makes the ribbon itself a visual representation of how far a structural transition has propagated through the stack.
➖Ribbon ORDER➖
The context table also displays Ribbon ORDER %. ORDER measures how efficiently the six averages form one monotonic path from OHLC5 through OHLC50. A perfectly ordered ribbon approaches 100%, while internal folding and crossover geometry progressively reduce the reading. The accompanying Bull/Bear x/5 value shows how many adjacent pairs have aligned contiguously from the fast edge. For example, Bull 3/5 means the first three adjacent relationships have transferred bullishly while the deeper structure has not yet completed the transition. ORDER describes the ribbon's current geometry. It does not override Global Regime ownership.
➖Developing higher-timeframe CORE➖
The table includes both the current chart-timeframe CORE and a Developing HTF CORE calculated on the automatically selected next higher timeframe. The higher-timeframe value is not created by resampling the chart-timeframe result. The complete six-RMA structural engine is calculated natively in the higher-timeframe context using the same REG BODY, ATR normalization, persistence guard, and Wide Semantic mapping. Because this is a developing higher-timeframe reading, it updates while the higher-timeframe candle is still forming. It can therefore change until that candle closes. This provides a direct comparison between current-timeframe structure and the developing structural condition immediately above it.
➖75 / 110 long structure➖
OHLC75 and OHLC110 form a separate slower structural pair. They do not participate in REG BODY, CORE, or Global Regime calculations. Their purpose is to provide a longer structural reference alongside the primary six-average ribbon. When 75 > 110, the long structure is displayed in orange. When 110 > 75, it is displayed in gray. The table also reports the current relationship directly—for example, 75 > 110—along with the number of bars since the most recent 75/110 crossover.
➖Price-relative OHLC labels➖
Each RMA level can be displayed in a right-side label containing the current level and its distance from price. The labels also maintain a persistent price-relative marker:
$⤴ means price most recently moved above that OHLC level.
$⤵ means price most recently moved below that OHLC level.
The marker persists until the opposite side takes ownership. This makes it possible to scan the right-side stack and quickly see where current price is positioned relative to multiple structural horizons. The short-horizon labels visually inherit the active ribbon gradient, while the 75/110 labels use their separate long-structure color owner.
➖Crossover events➖
Five crossover families are available. The 5/8 event represents the fast ribbon edge. 8/20 provides an optional early-intermediate structural crossover, while 13/34 represents a deeper middle-structure transition. 20/50 tracks slower primary-ribbon equilibrium, and 75/110 represents the separate long structural pair. Bullish crossover labels appear below the candle and bearish labels appear above it. Historical events preserve the exact Global Regime color that was active when the crossover occurred, allowing older events to retain their original structural context rather than being recolored by the current regime.
➖PlotCandles➖
Optional PlotCandles can color price directly from the active Global Regime while maintaining independent body, wick, and border transparency.
➖How I use the ribbon➖
The indicator is most useful when the components are read together rather than treating any one color or crossover as a standalone signal.
A clean, high-ORDER ribbon with expanding CORE reflects a very different structural environment from a similarly colored ribbon whose ORDER is deteriorating and whose fast-edge transition has already begun. When CORE is higher than its HTF value, tha'ts also a bullish sign (and vice versa). Likewise, disagreement between chart CORE and Developing HTF CORE can provide useful context. Strong local structure may be developing inside a weaker higher-timeframe environment, or a lower-timeframe transition may be occurring while the next timeframe remains firmly established.
The 75/110 pair provides another layer of context without contaminating the primary regime calculation. For that reason, I view the indicator primarily as a market-structure and context tool, rather than a mechanical entry/exit system.
➖Final note➖
Moving averages are inherently derived from historical price, and no ribbon can predict future market direction. CORE, ORDER, Global Regime states, crossover events, and Developing HTF readings should be interpreted as descriptions of current and developing structure—not guarantees of continuation or reversal.
The value of the indicator is in combining multi-horizon OHLC4 structure, volatility-normalized strength, persistent regime ownership, and visually progressive ribbon transitions into one coherent framework.
➖A few chart examples➖
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🆓 Free scripts:
⚡ Pro scripts: tradingview.com/script/hESCvPuH-Predictive-Volume-MTF-Pro/
🙋♂️ Get help with Pinescript: simplecrypto.life/get-help-with-pinescript
⚡ Pro scripts: tradingview.com/script/hESCvPuH-Predictive-Volume-MTF-Pro/
🙋♂️ Get help with Pinescript: simplecrypto.life/get-help-with-pinescript
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🆓 Free scripts:
⚡ Pro scripts: tradingview.com/script/hESCvPuH-Predictive-Volume-MTF-Pro/
🙋♂️ Get help with Pinescript: simplecrypto.life/get-help-with-pinescript
⚡ Pro scripts: tradingview.com/script/hESCvPuH-Predictive-Volume-MTF-Pro/
🙋♂️ Get help with Pinescript: simplecrypto.life/get-help-with-pinescript
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.