Risk-On / Risk-Off Score

This indicator calculates a custom Risk-On / Risk-Off Score to objectively assess the current market risk sentiment using a carefully selected basket of macroeconomic assets and intermarket relationships.
🧠 What does this indicator do?
The score is based on 14 key components grouped into three categories:
🟢 Risk-On Assets (rising = appetite for risk)
(+1 if performance over X days is positive, otherwise –1)
NASDAQ 100 (NAS100USD)
S&P 500 (SPX)
Bitcoin (BTCUSD)
Copper (HG1!)
WTI Crude Oil (CLK2025)
🔴 Risk-Off Assets (rising = flight to safety)
(–1 if performance is positive, otherwise +1)
Gold (XAUUSD)
US Treasury Bonds (TLT ETF) (TLT)
US Dollar Index (DXY)
USD/CHF
USD/JPY
US 10Y Yields (US10Y) (yields are interpreted inversely)
⚖️ Risk Spreads / Relative Indicators
(+1 if rising, –1 if falling)
Copper/Gold Ratio → HG1! / XAUUSD
NASDAQ/VIX Ratio → NAS100USD / VIX
HYG/TLT Ratio → HYG / TLT
📏 Score Calculation
Total score = sum of all components
Range: from –14 (extreme Risk-Off) to +14 (strong Risk-On)
Color-coded output:
🟢 Score > 2 = Risk-On
🟠 –2 to +2 = Neutral
🔴 Score < –2 = Risk-Off
Displayed as a line plot with background color and signal markers
🧪 Timeframe of analysis:
Default: 5 days (adjustable via input)
Calculated using Rate of Change (% change)
🧭 Use Cases:
Quickly assess macro sentiment
Filter for position sizing, hedging, or intraday bias
Especially useful for:
Swing traders
Day traders with macro filters
Volatility and options traders
📌 Note:
This is not a buy/sell signal indicator, but a contextual sentiment tool designed to help you stay aligned with overall market conditions.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.