What it visualizes
A fast/slow cohort ribbon, ensemble centerline, optional individual MAs and bundle envelope, lifecycle tint, a fixed bottom-left MA REGIME HUD and selected factual event markers. HUD detail can be Clean, Analyst or Research.
FreeOpen sourcePine Script v6
Treat up to eight moving averages as an ordered structure through pair order, slopes, fast/slow cohorts, bundle width and reorder rate. The current source expands the study into Bias, lifecycle Phase, MTF context, memory and forward-outcome research.
The public H1 remains Moving Average Structure Matrix, while the July 26, 2026 source identifies the expanded build as Moving Average Structure Matrix — Regime Transition Lab. It now covers Bias, Phase, Clarity, confirmed higher-timeframe context, completed-regime memory and conditional outcome samples.
A fast/slow cohort ribbon, ensemble centerline, optional individual MAs and bundle envelope, lifecycle tint, a fixed bottom-left MA REGIME HUD and selected factual event markers. HUD detail can be Clean, Analyst or Research.
MA distances and slopes are normalized by ATR, Percentage or Rolling stdev. Pair order, slope coherence, cohort spread, width rank and reorder rate feed Bias and Clarity, while a separate ruleset classifies lifecycle Phase.
Bias combines 45% order coherence, 30% slope coherence and 25% cohort bias. Phase classifies compression, release, expansion, pullback, deceleration or transition.
Order, purity, slope, energy and ties form a 0–100 clarity score after a reorder-rate penalty. It is not a profit probability.
Confirmed higher-timeframe structures can be compared, while completed episodes and conditional forward samples are summarized. This is not a strategy backtest.
Add the public script to a chart and identify every drawing in the default configuration first. Change only one input at a time.
Open the public Moving Average Structure Matrix page and add it to a TradingView chart. No SG Group account is required.
Overlapping lines, bands, backgrounds or tables can be duplicate drawings of the same kind of information. Never treat visual overlap by itself as stronger evidence or signal agreement. Another MA ribbon, EMA/SMA set, Ichimoku or Supertrend can duplicate up to eight MA lines, the fast/slow ribbon, centerline and bundle envelope. Lines meeting at one price are not independent support or resistance.
Do not turn one value or color into a conclusion. Check the condition, persistence and relationship to price in order.
Identify the preset, enabled MAs, normalization mode, required history and Chart/Anchor/Macro hierarchy.
BULLISH can coexist with COMPRESSION or DECELERATION; do not collapse the labels into one signal.
Clarity, WAITING HTF CLOSE, MEM and OUT describe conditions, not entries or win rate.
Composite MA-structure direction, not a trade recommendation.
Bundle compression / directional width emergence after recent compression.
Directional expansion / return inside the bundle while structure holds.
Falling energy/coherence/width / high-reorder transition.
A 0–100 clarity score for related MA structure, not win rate.
Waiting for confirmed higher-timeframe data / invalid timeframe order.
The labels below match the published script’s English Inputs panel. Defaults reflect the public source at the time of review and may change in a later TradingView update.
On small screens, each input is reformatted as a readable stacked card.
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Structure preset | Balanced Trend | options: Short Horizon, Balanced Trend, Long Horizon, Investor, Custom | Selects a reference MA configuration; Custom uses the eight slot settings. |
Source | close | Price series used for MA and price-location calculations. |
Slope lookback | 5 | range: 1–100 | Bars used to measure each MA's slope. |
Minimum warm-up bars | 80 | range: 20–2000 | Minimum history required before classification starts. |
Use automatic warm-up floor | true | Automatically raises warm-up to cover active calculation lengths. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Distance normalization | ATR | options: ATR, Percentage, Rolling stdev | Chooses ATR, percent, or rolling-standard-deviation normalization. |
ATR normalization length | 14 | range: 2–500 | ATR length used by ATR normalization. |
Rolling stdev length | 50 | range: 5–1000 | Lookback used by rolling-standard-deviation normalization. |
Pair tie threshold (normalized units) | 0.030 | min: 0 | step: 0.005 | Normalized separation below which an MA pair is treated as tied. |
Slope flat threshold (normalized units) | 0.020 | min: 0 | step: 0.005 | Normalized slope magnitude treated as flat. |
Slope energy = 100 scale | 0.300 | min: 0.001 | step: 0.01 | Normalized slope energy corresponding to a score of 100. |
Cohort spread = ±100 scale | 0.300 | min: 0.001 | step: 0.01 | Fast/slow cohort spread corresponding to a ±100 score. |
Horizon-distance weight power | 1.0 | range: 0–3 | step: 0.25 | Controls weighting by analytical-horizon distance. |
Horizon ordering | Manual rank | options: Manual rank, Length ascending | Orders analytical horizons by explicit rank or ascending length. |
Bundle-width rank lookback | 250 | range: 20–2000 | Lookback for the bundle-width percentile rank. |
Bundle-width motion bars | 3 | range: 1–50 | Bars used to measure bundle-width change. |
Reorder-rate lookback | 50 | range: 5–500 | Lookback used to calculate pair reorder rate. |
Fast/slow cohort split | Horizon rank | options: Horizon rank, Median length, Manual length | Method used to split enabled MAs into fast and slow cohorts. |
Fast cohort maximum rank | 4 | range: 1–7 | Highest horizon rank included in the fast cohort. |
Fast cohort maximum length | 50 | range: 1–5000 | Maximum MA length included in the fast cohort under manual split. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Bias composite threshold | 22.0 | range: 0–100 | step: 1 | Absolute composite threshold for Bullish or Bearish bias. |
Directional order threshold | 62.0 | range: 0–100 | step: 1 | Order-coherence threshold for a directional structure. |
Directional slope coherence | 45.0 | range: 0–100 | step: 1 | Slope-coherence threshold for directional alignment. |
Compression width-rank maximum | 18.0 | range: 0–100 | step: 1 | Maximum bundle-width rank allowed for Compression. |
Compression energy maximum | 32.0 | range: 0–100 | step: 1 | Maximum slope-energy score allowed for Compression. |
Compression |order| maximum | 35.0 | range: 0–100 | step: 1 | Maximum absolute order coherence allowed for Compression. |
Release |order| minimum | 48.0 | range: 0–100 | step: 1 | Minimum absolute order coherence required for Release. |
Release width expansion minimum | 0.005 | min: 0 | step: 0.005 | Minimum normalized width expansion required for Release. |
Release centroid acceleration minimum | 0.0 | min: 0 | step: 0.005 | Minimum direction-aligned centroid acceleration for Release. |
Compression-to-release origin window | 3 | range: 1–20 | Bars within which a prior Compression can seed Release. |
Pullback order-hold floor | 25.0 | range: 0–100 | step: 1 | Minimum directional order retained during Pullback. |
Slow-cohort slope-hold threshold | 15.0 | range: 0–100 | step: 1 | Minimum directional slow-cohort slope retained during Pullback. |
Deceleration comparison bars | 5 | range: 1–50 | Comparison interval for Deceleration tests. |
Deceleration energy drop | 8.0 | range: 0–100 | step: 1 | Slope-energy decline sufficient for Deceleration. |
Deceleration coherence drop | 10.0 | range: 0–100 | step: 1 | Slope-coherence decline sufficient for Deceleration. |
Deceleration width contraction | 0.005 | min: 0 | step: 0.005 | Normalized bundle contraction sufficient for Deceleration. |
Churn reorder-rate threshold | 5.0 | range: 0–100 | step: 0.5 | Reorder-rate threshold associated with churning structure. |
Clarity penalty per reorder-rate point | 1.5 | range: 0–10 | step: 0.25 | Clarity points deducted per reorder-rate point. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable anchor timeframe | true | Enables the anchor-timeframe comparison. |
Anchor | 240 | Anchor timeframe; 240 is four hours. |
Enable macro timeframe | true | Enables the macro-timeframe comparison. |
Macro | 1D | Macro timeframe. |
Requested HTF calculation bars | 5000 | range: 500–10000 | Requested history for higher-timeframe calculations. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable completed-episode memory | true | Stores and summarizes completed bias/phase episodes. |
Maximum completed episodes per state | 120 | range: 20–300 | Maximum completed episodes retained for each state. |
Minimum samples before interpretation | 20 | range: 5–100 | Minimum memory samples before interpretation. |
Persistence horizon (additional bars) | 10 | range: 1–100 | Additional bars used to measure persistence. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable forward outcome study | true | Enables descriptive forward-outcome sampling after events. |
Study event | Pullback Reclaim | options: Compression Release, Pullback Reclaim, Structural Failure, MTF Alignment, Expansion Entry | Selects the event sampled by the outcome study. |
Forward horizon (bars) | 20 | range: 1–250 | Bars measured after each study event. |
Maximum completed samples | 200 | range: 20–500 | Maximum completed outcome samples retained. |
Minimum samples before interpretation | 20 | range: 5–100 | Minimum outcome samples before interpretation. |
Use non-overlapping samples | true | Prevents overlapping forward windows from becoming separate samples. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Confirm events on bar close | true | Restricts events to confirmed bar closes. |
Phase bars before phase-entry event | 1 | range: 1–20 | Phase persistence required before a phase-entry event. |
One displayed event per bar | true | Limits displayed output to one event per bar. |
Displayed-event cooldown bars | 0 | range: 0–100 | Cooldown between displayed events. |
Maximum event labels | 40 | range: 10–300 | Maximum event labels retained on the chart. |
Structural-failure order floor | 10.0 | range: 0–100 | step: 1 | Order floor used by structural-failure detection. |
Structural-failure slow-slope flip | 5.0 | range: 0–100 | step: 1 | Slow-cohort slope threshold used by structural-failure detection. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Show individual MAs | false | Shows every enabled MA line. |
Show fast/slow structure ribbon | true | Shows the fast/slow cohort structure ribbon. |
Show ensemble centerline | true | Shows the enabled-MA ensemble centerline. |
Show full MA bundle envelope | false | Shows the full MA bundle high/low envelope. |
Fill full MA bundle | false | Fills the complete MA bundle envelope. |
Show lifecycle background tint | false | Tints the chart background by lifecycle phase. |
Show fixed bottom-left regime HUD | true | Shows the fixed bottom-left regime HUD. |
HUD detail | Clean | options: Clean, Analyst, Research | Selects Clean, Analyst, or Research HUD detail. |
HUD text size | Normal | options: Tiny, Small, Normal, Large | Sets HUD text size. |
HUD clearance above TradingView logo (%) | 6 | range: 3–16 | Adds bottom clearance above the TradingView logo. |
Use HUD icons | true | Uses icons in the HUD. |
Use HUD meters | true | Uses compact visual meters in the HUD. |
Marker display | Major only | options: Off, Major only, Key events, All events | Selects which event markers are drawn over price. |
Use marker icons | true | Uses icons in chart markers. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Bullish / cyan | #00C2FF | Bullish structure color. |
Bearish / orange | #FF7A45 | Bearish structure color. |
Neutral | #8A93A6 | Neutral structure color. |
Accent / violet | #B56CFF | Accent color used for highlighted context such as Release. |
Compression | #5F6B82 | Compression phase color. |
Deceleration | #F2C94C | Deceleration phase color. |
Dashboard header | #0B1220 | HUD header background color. |
Dashboard panel | #101A2E | HUD primary panel background color. |
Dashboard alternate | #14213A | HUD alternate panel background color. |
Dashboard border | #284564 | HUD border color. |
Dashboard primary text | #EAF2FF | HUD primary text color. |
Dashboard muted text | #8FA5BF | HUD muted text color. |
Marker text | #FFFFFF | Marker text color. |
Marker transparency | 5 | range: 0–100 | Marker transparency. |
Preset MA transparency | 35 | range: 0–100 | Preset MA line transparency. |
Centerline transparency | 10 | range: 0–100 | Ensemble centerline transparency. |
Ribbon base transparency | 72 | range: 0–100 | Base transparency of the cohort ribbon. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 1. |
Type | EMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 1. |
Length | 5 | range: 1–4000 | Calculation length for slot 1. |
Horizon rank | 1 | range: 1–8 | Analytical horizon rank for slot 1; lower is faster and equal ranks are skipped. |
Name | Fast 1 | Display name for slot 1. |
Color | #00B8FF | Line color for slot 1. |
Width | 1 | range: 1–4 | Line width for slot 1. |
Transparency | 35 | range: 0–100 | Line transparency for slot 1. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 2. |
Type | EMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 2. |
Length | 10 | range: 1–4000 | Calculation length for slot 2. |
Horizon rank | 2 | range: 1–8 | Analytical horizon rank for slot 2; lower is faster and equal ranks are skipped. |
Name | Fast 2 | Display name for slot 2. |
Color | #00E0C6 | Line color for slot 2. |
Width | 1 | range: 1–4 | Line width for slot 2. |
Transparency | 35 | range: 0–100 | Line transparency for slot 2. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 3. |
Type | EMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 3. |
Length | 20 | range: 1–4000 | Calculation length for slot 3. |
Horizon rank | 3 | range: 1–8 | Analytical horizon rank for slot 3; lower is faster and equal ranks are skipped. |
Name | Fast 3 | Display name for slot 3. |
Color | #6C7BFF | Line color for slot 3. |
Width | 1 | range: 1–4 | Line width for slot 3. |
Transparency | 35 | range: 0–100 | Line transparency for slot 3. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 4. |
Type | SMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 4. |
Length | 50 | range: 1–4000 | Calculation length for slot 4. |
Horizon rank | 4 | range: 1–8 | Analytical horizon rank for slot 4; lower is faster and equal ranks are skipped. |
Name | Core 1 | Display name for slot 4. |
Color | #B56CFF | Line color for slot 4. |
Width | 1 | range: 1–4 | Line width for slot 4. |
Transparency | 35 | range: 0–100 | Line transparency for slot 4. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 5. |
Type | SMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 5. |
Length | 100 | range: 1–4000 | Calculation length for slot 5. |
Horizon rank | 5 | range: 1–8 | Analytical horizon rank for slot 5; lower is faster and equal ranks are skipped. |
Name | Slow 1 | Display name for slot 5. |
Color | #F45B9A | Line color for slot 5. |
Width | 1 | range: 1–4 | Line width for slot 5. |
Transparency | 35 | range: 0–100 | Line transparency for slot 5. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | true | Enables MA slot 6. |
Type | SMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 6. |
Length | 200 | range: 1–4000 | Calculation length for slot 6. |
Horizon rank | 6 | range: 1–8 | Analytical horizon rank for slot 6; lower is faster and equal ranks are skipped. |
Name | Slow 2 | Display name for slot 6. |
Color | #FFAA3D | Line color for slot 6. |
Width | 1 | range: 1–4 | Line width for slot 6. |
Transparency | 35 | range: 0–100 | Line transparency for slot 6. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | false | Enables MA slot 7. |
Type | EMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 7. |
Length | 34 | range: 1–4000 | Calculation length for slot 7. |
Horizon rank | 7 | range: 1–8 | Analytical horizon rank for slot 7; lower is faster and equal ranks are skipped. |
Name | Custom 7 | Display name for slot 7. |
Color | #7D8A99 | Line color for slot 7. |
Width | 1 | range: 1–4 | Line width for slot 7. |
Transparency | 45 | range: 0–100 | Line transparency for slot 7. |
| Input label | Default / options | What it controls and when to adjust it |
|---|---|---|
Enable | false | Enables MA slot 8. |
Type | SMA | options: EMA, SMA, WMA, RMA, HMA, DEMA, TEMA, VWMA, ALMA, KAMA | Moving-average method for slot 8. |
Length | 300 | range: 1–4000 | Calculation length for slot 8. |
Horizon rank | 8 | range: 1–8 | Analytical horizon rank for slot 8; lower is faster and equal ranks are skipped. |
Name | Custom 8 | Display name for slot 8. |
Color | #AAB4C3 | Line color for slot 8. |
Width | 1 | range: 1–4 | Line width for slot 8. |
Transparency | 45 | range: 0–100 | Line transparency for slot 8. |
Alerts are state, touch or transition events defined in the public source. They are not trade instructions.
This tool is for analysis and visualization. It is not investment advice, a trade recommendation, a forecast, or a promise of profit or accuracy. Results depend on inputs, symbol, timeframe, and data feed. You remain responsible for every trading decision.
Alignment and high Clarity do not guarantee continuation, and CHURN does not guarantee reversal. Presets are not optimized strategies.
MEM and OUT depend on symbol, timeframe, configuration and available history. Changing inputs changes the sample; it is not probability of profit or a backtest result.
The catalogue and initial description focus on the older Matrix. This guide prioritizes the current 1,613-line Regime Transition Lab source.
Do not count Bias, Phase, Clarity, MTF and OUT as separate votes. They are related derivatives of the same moving-average structure, not independent evidence.
Clarify the current version, Bias versus Phase, MTF handling and outcome statistics.
Yes. It is a free, open-source indicator published by SG Group on TradingView. Review TradingView’s terms and the conditions attached to the public script before reuse or redistribution.
Start with the published defaults and observe the drawings and state changes first. Then change one input at a time for the symbol, timeframe and data feed so you can identify what caused each visual change.
Yes, but similar lines, bands, backgrounds and tables can overlap and obscure their source. Isolate each indicator first and hide duplicate components. Visual overlap alone is not stronger evidence or signal agreement.
No. It is analysis and visualization context consistent with the public description. It does not provide entries, exits, targets, stops, price forecasts, or promises of profit, win rate or accuracy.
No. It is a sign frequency in completed conditional samples. It contains no trade rules, fees, execution or position management, and changing the configuration changes the sample.
This guide is grounded in SG Group’s live catalogue, the script’s published TradingView description, and the user-facing inputs in its open source. Labels and defaults can change after a script update.