OPEN-SOURCE SCRIPT

CMC Macro Regime Panel

87
Overview (what it is):
A macro‑regime gate built entirely from TradingView-native symbols (CRYPTOCAP, FRED, DXY/VIX, HYG/LQD). It aggregates central‑bank liquidity (Fed balance sheet − RRP − Treasury General Account), USD strength, credit conditions, stablecoin flows/dominance, tech beta and BTC–NDX co‑move into one normalized score (CLRC). The panel outputs Risk‑ON/OFF regimes, an Early 3/5 pre‑signal, and an automatic BTC vs ETH vs ALTs preference. It is intentionally scoped to Daily & Weekly reads (no intraday timing). Publish with a clean chart and a clear description as per TradingView rules.
TradingView

Why we also use other TradingView screens (and why that is compliant)

This script pulls data via request.security() from official TV symbols only; users often want to open the raw series on separate charts to sanity‑check:

CRYPTOCAP indices: TOTAL, TOTAL2, TOTAL3 (market cap aggregates) and dominance tickers like BTC.D, USDT.D. Helpful for regime & rotation (ALTs vs BTC). TradingView provides definitions for crypto market cap and dominance symbols.
TradingView
+3
TradingView
+3
TradingView
+3

FRED releases: WALCL (Fed assets, weekly), RRPONTSYD (ON RRP, daily), WTREGEN (TGA, weekly), M2SL (M2, monthly). These are the official macro sources exposed on TV.
FRED
+3
FRED
+3
FRED
+3

Risk proxies: TVC:DXY (USD index), TVC:VIX (implied vol), AMEX:HYG/AMEX:LQD (credit), NASDAQ:NDX (tech beta), BINANCE:ETHBTC. VIX/NDX relationship is well-documented; VIX measures 30‑day expected S&P500 vol.
TradingView
+2
TradingView
+2

Compliance note: Using multiple screens is optional for users, but it explains/justifies how components work together (a requirement for public scripts). Keep publication chart clean; use extra screens only to illustrate in the description.
TradingView

How it works (high level)

Liquidity block (Weekly/Monthly)
Net Liquidity = WALCL − RRPONTSYD − WTREGEN (YoY z‑score). WALCL is weekly (as of Wednesday) via H.4.1; RRP is daily; TGA is a Fed liability series. M2 YoY is monthly.
FRED
+3
FRED
+3
FRED
+3

Risk conditions (Daily)
DXY 3‑month momentum (inverted), VIX level (inverted), Credit (HYG/LQD ratio or HY OAS). VIX is a 30‑day constant‑maturity implied vol index per Cboe methodology.
Cboe
+1

Crypto‑internal (Daily)
Stablecoins (USDT+USDC+DAI 30‑day log change), USDT dominance (20‑day, inverted), TOTAL3 (63‑day momentum). Dominance symbols on TV follow a documented formula.
TradingView

Beta & co‑move (Daily)
NDX 63‑day momentum, BTC↔NDX 90‑day correlation.

All components become z‑scores (optionally clipped), weighted, missing inputs drop and weights renormalize. We never use lookahead; we confirm on bar close to avoid repainting per Pine docs (barstate.isconfirmed, multi‑TF).
TradingView
+2
TradingView
+2

What you see on the chart

White line (CLRC) = macro regime score.

Background: Green = Risk‑ON, Red = Risk‑OFF, Teal = Early 3/5 (pre‑signal).

Table: shows each component’s z‑score and the Preference: BTC / ETH / ALTs / Mixed.

Signals & interpretation

Designed for Daily (1D) and Weekly (1W) only.

Regime gates (default Fast preset):

Enter ON: CLRC ≥ +0.8; Hold ON while ≥ +0.5.

Enter OFF: CLRC ≤ −1.0; Hold OFF while ≤ −0.5.

0 / ±1 reading: CLRC is a standardized composite.

~0 = neutral baseline (no macro edge).

≥ +1 = strong macro tailwind (≈ +1σ).

≤ −1 = strong headwind (≈ −1σ).

Early 3/5 (teal): a fast pre‑signal when at least 3 of 5 daily checks align: USDT.D↓, DXY↓, VIX↓, HYG/LQD↑, ETHBTC↑ or TOTAL3↑. It often precedes a full ON flip—use for pre‑positioning rather than full sizing.

BTC/ETH/ALTs selector (only when ON):

ALTs when BTC.D↓ and (ETHBTC↑ or TOTAL3↑) ⇒ rotate down the risk curve.

BTC when BTC.D↑ and ETHBTC↓ ⇒ keep it concentrated.

ETH when ETHBTC↑ while BTC.D flat/up ⇒ add ETH beta.
(Dominance mechanics are documented by TV.)
TradingView

Dissonance (incompatibility) rules — when to stand down

Use these overrides to avoid false comfort:

CLRC > +1 but USDT.D↑ and/or VIX spikes day‑over‑day → downgrade to Neutral; wait for USDT.D to stabilize and VIX to cool (VIX is a fear gauge of 30‑day expectation).
Cboe Global Markets

CLRC > +1 but DXY↑ sharply (USD squeeze) → size below normal; require DXY momentum to roll over.

CLRC < −1 but Early 3/5 = true two days in a row → start reducing underweights; look for ON flip within a few bars.

NetLiq improving (W) but credit (HYG/LQD) deteriorating (D) → treat as mixed regime; prefer BTC over ALTs.

How to use (step‑by‑step)

A. Read on Daily (1D) — main regime

Open CRYPTOCAP:TOTAL3, 1D (panel applied).

Wait for bar close (use alerts on confirmed bar). Pine docs recommend barstate.isconfirmed to avoid repainting on realtime bars.
TradingView

If ON, check Preference (BTC / ETH / ALTs).

Then drop to 4H on your trading pair for micro entries (this indicator itself is not for intraday timing).

B. Confirm weekly macro (1W) — once per week)

Review WALCL/RRP/TGA after the H.4.1 release on Thursdays ~4:30 pm ET. WALCL is “Weekly, as of Wednesday”; M2 is Monthly—so do not expect daily responsiveness from these.
Federal Reserve
+2
FRED
+2

Recommended check times (practical schedule)

Daily regime read: right after your chart’s daily close (confirmed bar). For consistent timing across crypto, many users set chart timezone to UTC and read ~00:05 UTC; you can change chart timezone in TV’s settings.
TradingView

In‑day monitoring: optional spot checks 16:00 & 20:00 UTC (DXY/VIX move during US hours), but act only after the daily bar confirms.

Weekly macro pass: Thu 21:30–22:30 UTC (after H.4.1 4:30 pm ET) or Fri after daily close, to let weekly FRED series propagate.
Federal Reserve

Limitations & data latency (be explicit)

Higher‑TF data & confirmation: FRED weekly/monthly series will not reflect intraday risk in crypto; we aggregate them for regime, not for entry timing.

Repainting 101: Realtime bars move until close. This script does not use lookahead and follows Pine guidance on multi‑TF series; still, always act on confirmed bars.
TradingView
+1

Public‑library compliance: Title EN‑only; description starts in EN; clean chart; justify component mash‑up; no lookahead; no unrealistic claims.
TradingView

Alerts you can use

“Macro Risk‑ON (entry)” — fires on ON flip (confirmed bar).

“Macro Risk‑OFF (entry)” — fires on OFF flip.

“Early 3/5” — fires when the teal pre‑signal appears (not a regime flip).

“Preference change” — BTC/ETH/ALTs toggles while ON.

Publish note: Alerts are fine; just avoid implying guaranteed accuracy/performance.
TradingView

Background research (why these inputs matter)

Liquidity → Crypto: Fed H.4.1 timing and series definitions (WALCL, RRP, TGA) formalize the “net liquidity” concept used here.
FRED
+3
Federal Reserve
+3
FRED
+3

Stablecoins ↔ Non‑stable crypto: empirical work shows bi‑directional causality between stablecoin market cap and non‑stable crypto cap; stablecoin growth co‑moves with broader crypto activity.

Global liquidity link: world liquidity positively relates to total crypto market cap; lagged effects are observed at monthly horizons.

VIX/Uncertainty effect: fear shocks impair BTC’s “safe haven” behavior; VIX is a meaningful risk‑off read.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.