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.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
TheRealMongoose
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
TheRealMongoose
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.