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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
TheRealMongoose
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
TheRealMongoose
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน