OPEN-SOURCE SCRIPT

Mongoose Compass Ribbon — Regime Overlay & Sizing

21
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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。