OPEN-SOURCE SCRIPT
Badawy_Macro Risk Dashboard

# 🔥 **Macro Risk Dashboard – Institutional Regime Indicator**
## 📊 **Overview**
The **Macro Risk Dashboard** is a multi-asset, institutional-grade indicator designed to quantify the overall market environment into a single **Macro Score (0–100)**.
It aggregates key macro signals across:
* Volatility
* Liquidity
* Growth
* Credit Markets
Then transforms them into a **clear Risk-On / Risk-Off regime**.
👉 Built for traders who want to think like institutions — not retail noise.
---
## 🧠 **Core Idea**
Instead of relying on price alone, this indicator reads the **macro engine behind the market**:
| Component | What it Measures | Signal Logic |
| ---------- | ------------------------ | ---------------------------- |
| VIX | Market fear | Lower = Bullish |
| DXY | Dollar strength | Lower = Risk On |
| US10Y | Yields / liquidity | Lower = Liquidity expansion |
| QQQ | Growth / Tech leadership | Above MA = Bullish |
| HYG vs TLT | Credit risk appetite | Risk assets outperform bonds |
Each component contributes to a weighted score → final **Macro Score**
📌 Source logic from your script:
---
## ⚙️ **How It Works**
### 1️⃣ Scoring Engine
Each macro block contributes:
* **Liquidity (US10Y + DXY)** → 50 pts
* **Volatility (VIX)** → 25 pts
* **Growth (QQQ)** → 25 pts
* **Credit (HYG vs TLT)** → 18 pts
Score is normalized to:
👉 **0 → 100 scale**
---
### 2️⃣ Regime Detection
* 🟢 **Risk ON** → Score ≥ 70
* 🔴 **Risk OFF** → Score ≤ 45
* 🟠 **Neutral** → Between both
---
### 3️⃣ Visual Feedback
* Colored line:
* Green → Risk On
* Red → Risk Off
* Orange → Neutral
* Background shading reflects regime
* Labels appear when regime changes
* Dashboard table shows real-time macro states
---
## 📈 **How to Use It**
### 🟢 Risk ON Environment
* Favor:
* Growth stocks (QQQ, SOXL)
* Breakouts
* Trend-following
* Strategy:
* Buy dips
* Aggressive positioning
---
### 🔴 Risk OFF Environment
* Favor:
* Defensive assets
* Gold / bonds
* Shorts / hedges
* Strategy:
* Reduce exposure
* Protect capital
---
### 🟠 Neutral
* Range trading
* Lower conviction trades
* Wait for confirmation
---
## 🎯 **Best Use Cases**
* Swing Trading
* Macro Trading
* Portfolio Allocation
* Risk Management Layer (VERY powerful)
---
## ⚡ **Why This Indicator is Powerful**
* Combines **6 macro markets** into 1 signal
* Filters fake moves driven by liquidity
* Works across all timeframes
* Adapts automatically if data is missing
* Thinks like **institutional flow**, not price-only indicators
---
## ⚠️ **Important Notes**
* This is a **macro regime tool**, not a direct entry signal
* Should be combined with:
* Price action
* Volume
* Execution strategy
* No repainting (uses confirmed data)
* Slight lag due to moving averages (by design for stability)
---
## 🧪 **Pro Tip (Advanced)**
Use it as a **master filter**:
❌ Don’t take longs if Risk = OFF
❌ Don’t short aggressively if Risk = ON
👉 This alone can eliminate 50–70% of bad trades.
---
## 🏷️ **Tags**
#Macro #RiskOn #RiskOff #SmartMoney #Institutional #VIX #DXY #QQQ #Liquidity #TradingView #MarketRegime #Quant
## 📊 **Overview**
The **Macro Risk Dashboard** is a multi-asset, institutional-grade indicator designed to quantify the overall market environment into a single **Macro Score (0–100)**.
It aggregates key macro signals across:
* Volatility
* Liquidity
* Growth
* Credit Markets
Then transforms them into a **clear Risk-On / Risk-Off regime**.
👉 Built for traders who want to think like institutions — not retail noise.
---
## 🧠 **Core Idea**
Instead of relying on price alone, this indicator reads the **macro engine behind the market**:
| Component | What it Measures | Signal Logic |
| ---------- | ------------------------ | ---------------------------- |
| VIX | Market fear | Lower = Bullish |
| DXY | Dollar strength | Lower = Risk On |
| US10Y | Yields / liquidity | Lower = Liquidity expansion |
| QQQ | Growth / Tech leadership | Above MA = Bullish |
| HYG vs TLT | Credit risk appetite | Risk assets outperform bonds |
Each component contributes to a weighted score → final **Macro Score**
📌 Source logic from your script:
---
## ⚙️ **How It Works**
### 1️⃣ Scoring Engine
Each macro block contributes:
* **Liquidity (US10Y + DXY)** → 50 pts
* **Volatility (VIX)** → 25 pts
* **Growth (QQQ)** → 25 pts
* **Credit (HYG vs TLT)** → 18 pts
Score is normalized to:
👉 **0 → 100 scale**
---
### 2️⃣ Regime Detection
* 🟢 **Risk ON** → Score ≥ 70
* 🔴 **Risk OFF** → Score ≤ 45
* 🟠 **Neutral** → Between both
---
### 3️⃣ Visual Feedback
* Colored line:
* Green → Risk On
* Red → Risk Off
* Orange → Neutral
* Background shading reflects regime
* Labels appear when regime changes
* Dashboard table shows real-time macro states
---
## 📈 **How to Use It**
### 🟢 Risk ON Environment
* Favor:
* Growth stocks (QQQ, SOXL)
* Breakouts
* Trend-following
* Strategy:
* Buy dips
* Aggressive positioning
---
### 🔴 Risk OFF Environment
* Favor:
* Defensive assets
* Gold / bonds
* Shorts / hedges
* Strategy:
* Reduce exposure
* Protect capital
---
### 🟠 Neutral
* Range trading
* Lower conviction trades
* Wait for confirmation
---
## 🎯 **Best Use Cases**
* Swing Trading
* Macro Trading
* Portfolio Allocation
* Risk Management Layer (VERY powerful)
---
## ⚡ **Why This Indicator is Powerful**
* Combines **6 macro markets** into 1 signal
* Filters fake moves driven by liquidity
* Works across all timeframes
* Adapts automatically if data is missing
* Thinks like **institutional flow**, not price-only indicators
---
## ⚠️ **Important Notes**
* This is a **macro regime tool**, not a direct entry signal
* Should be combined with:
* Price action
* Volume
* Execution strategy
* No repainting (uses confirmed data)
* Slight lag due to moving averages (by design for stability)
---
## 🧪 **Pro Tip (Advanced)**
Use it as a **master filter**:
❌ Don’t take longs if Risk = OFF
❌ Don’t short aggressively if Risk = ON
👉 This alone can eliminate 50–70% of bad trades.
---
## 🏷️ **Tags**
#Macro #RiskOn #RiskOff #SmartMoney #Institutional #VIX #DXY #QQQ #Liquidity #TradingView #MarketRegime #Quant
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.