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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.