OPEN-SOURCE SCRIPT
Mongoose Compass Ribbon — Regime Overlay & Sizing

What it does
Mongoose Compass Ribbon paints the price chart background by market regime and displays a suggested position size.
It mirrors the Compass panel’s 4-pillar score (0–4) and can lock calculations to Weekly while you view Daily or intraday charts.
Regimes
Expansion: score ≥ 3 (green)
Neutral: score = 2 (orange)
Contraction: score ≤ 1 (red)
Pillars (same as panel):
RS IWM/SPY (small-cap leadership)
Credit HYG/LQD (risk financing)
Growth Copper/Gold (cyclical vs safety)
Participation (first available): Breadth → CBOE:DSPX → RSP/SPY proxy
A floating label shows Score and Suggested size (default ramp: 0/30/60/90/100% for scores 0–4).
How to use
Anchor on Weekly. Keep Regime Timeframe = W so the ribbon shows the higher-timeframe state while you trade on Daily.
Act on flips:
Expansion (≥3): increase beta, reduce hedges.
Neutral (2): keep moderate beta; favor quality/mega vs small caps until RS or Cu/Au turns.
Contraction (≤1): de-risk, rotate defensive, add hedges.
Turn on the built-in alerts: Expansion Regime and Contraction Regime.
Methodology
Prices are fetched via request.security on the selected Regime Timeframe.
Each pillar uses ratio signals smoothed with an SMA (Smoothing Length), and binary rules:
RS / Credit / Growth: fast SMA(len) vs slow SMA(len*2)
Breadth: normalized > 60
DSPX: normalized < 40
RSP/SPY proxy: fast > slow
Score is the count of green pillars (0–4).
Suggested size is a fixed mapping from score (user-editable).
Settings
Sources
Defaults use liquid ETFs (BATS/AMEX). Copper/Gold can be switched to futures if your plan supports them.
Breadth (optional): paste a %>MA symbol if you have one. If blank, the script uses CBOE:DSPX; if DSPX isn’t available it falls back to RSP/SPY.
Calculation
Smoothing Length (20) – higher = steadier regime; lower = faster.
Normalization Length (60) – window for 0–100 scaling in pillar tests.
Regime Timeframe (W) – lock regime to Weekly while viewing lower timeframes.
Visual
Ribbon Opacity controls how strong the background shading is.
Recommended usage
Apply the Ribbon to SPY/ES (broad beta) or IWM/RTY (small-cap rotation).
Pair it with the Mongoose Compass v2 panel in a separate pane for the full dashboard.
Limitations & disclaimer
For information and education; not investment advice.
Data availability varies by plan (especially futures and DSPX). Fallbacks apply automatically.
Mongoose Compass Ribbon paints the price chart background by market regime and displays a suggested position size.
It mirrors the Compass panel’s 4-pillar score (0–4) and can lock calculations to Weekly while you view Daily or intraday charts.
Regimes
Expansion: score ≥ 3 (green)
Neutral: score = 2 (orange)
Contraction: score ≤ 1 (red)
Pillars (same as panel):
RS IWM/SPY (small-cap leadership)
Credit HYG/LQD (risk financing)
Growth Copper/Gold (cyclical vs safety)
Participation (first available): Breadth → CBOE:DSPX → RSP/SPY proxy
A floating label shows Score and Suggested size (default ramp: 0/30/60/90/100% for scores 0–4).
How to use
Anchor on Weekly. Keep Regime Timeframe = W so the ribbon shows the higher-timeframe state while you trade on Daily.
Act on flips:
Expansion (≥3): increase beta, reduce hedges.
Neutral (2): keep moderate beta; favor quality/mega vs small caps until RS or Cu/Au turns.
Contraction (≤1): de-risk, rotate defensive, add hedges.
Turn on the built-in alerts: Expansion Regime and Contraction Regime.
Methodology
Prices are fetched via request.security on the selected Regime Timeframe.
Each pillar uses ratio signals smoothed with an SMA (Smoothing Length), and binary rules:
RS / Credit / Growth: fast SMA(len) vs slow SMA(len*2)
Breadth: normalized > 60
DSPX: normalized < 40
RSP/SPY proxy: fast > slow
Score is the count of green pillars (0–4).
Suggested size is a fixed mapping from score (user-editable).
Settings
Sources
Defaults use liquid ETFs (BATS/AMEX). Copper/Gold can be switched to futures if your plan supports them.
Breadth (optional): paste a %>MA symbol if you have one. If blank, the script uses CBOE:DSPX; if DSPX isn’t available it falls back to RSP/SPY.
Calculation
Smoothing Length (20) – higher = steadier regime; lower = faster.
Normalization Length (60) – window for 0–100 scaling in pillar tests.
Regime Timeframe (W) – lock regime to Weekly while viewing lower timeframes.
Visual
Ribbon Opacity controls how strong the background shading is.
Recommended usage
Apply the Ribbon to SPY/ES (broad beta) or IWM/RTY (small-cap rotation).
Pair it with the Mongoose Compass v2 panel in a separate pane for the full dashboard.
Limitations & disclaimer
For information and education; not investment advice.
Data availability varies by plan (especially futures and DSPX). Fallbacks apply automatically.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
TheRealMongoose
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
TheRealMongoose
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.