OPEN-SOURCE SCRIPT
已更新 Macro Risk On/Off Sentiment

Overview
As an Ichimoku trader, I've always found it crucial to understand the broader market sentiment before entering trades. That's why I developed this Macro Risk On/Off Sentiment Indicator. It's designed to provide a comprehensive view of global market risk sentiment by analysing multiple factors across different asset classes. By combining nine key market indicators, it produces an overall risk sentiment score, giving me a clearer picture of the market's mood before I apply my Ichimoku strategy.
Rationale
While Ichimoku is powerful for identifying trends and potential entry points, I realised it doesn't always capture the broader market context. Markets don't exist in isolation—they're influenced by a myriad of factors including volatility, economic indicators, and cross-asset relationships. By creating this indicator, I aimed to fill that gap, providing myself with a macro view that complements my Ichimoku analysis.
How It Works
The indicator analyses nine different market factors:
Each factor is assigned a score based on its z-score relative to its recent history, then weighted according to its perceived importance. The overall risk score is a weighted average of these individual scores.
How I Use It
Before applying my Ichimoku strategy, I first check this indicator to gauge the overall market sentiment:
In a risk-on environment (positive score):
In a risk-off environment (negative score):
The strength of the sentiment is reflected in how close the score is to either 1 (strong risk-on) or -1 (strong risk-off). This helps me gauge how aggressive or conservative I should be with my Ichimoku trades.
Customisation
I've designed this indicator to be flexible. You can modify it to:
By combining this Macro Risk On/Off Sentiment Indicator with my Ichimoku analysis, I've found I can make more informed trading decisions, taking into account both the technical setups I see on the chart and the broader market context.
As an Ichimoku trader, I've always found it crucial to understand the broader market sentiment before entering trades. That's why I developed this Macro Risk On/Off Sentiment Indicator. It's designed to provide a comprehensive view of global market risk sentiment by analysing multiple factors across different asset classes. By combining nine key market indicators, it produces an overall risk sentiment score, giving me a clearer picture of the market's mood before I apply my Ichimoku strategy.
Rationale
While Ichimoku is powerful for identifying trends and potential entry points, I realised it doesn't always capture the broader market context. Markets don't exist in isolation—they're influenced by a myriad of factors including volatility, economic indicators, and cross-asset relationships. By creating this indicator, I aimed to fill that gap, providing myself with a macro view that complements my Ichimoku analysis.
How It Works
The indicator analyses nine different market factors:
- VIX (Volatility Index): Measures market expectations of near-term volatility.
- S&P 500 Performance: Represents the overall US stock market performance.
- US 10-Year Treasury Yield: Indicates bond market sentiment and economic outlook.
- Gold Price Movement: Often seen as a safe-haven asset.
- US Dollar Index: Measures the strength of the USD against a basket of currencies.
- Emerging Markets Performance: Represents risk appetite for higher-risk markets.
- High Yield Bond Spreads: Indicates credit market risk sentiment.
- Copper/Gold Ratio: An economic growth indicator.
- Put/Call Ratio: Measures overall market sentiment based on options trading.
Each factor is assigned a score based on its z-score relative to its recent history, then weighted according to its perceived importance. The overall risk score is a weighted average of these individual scores.
How I Use It
Before applying my Ichimoku strategy, I first check this indicator to gauge the overall market sentiment:
- I look at the blue line plotted on the chart, which represents the overall risk score.
- I note the background colour: green for risk-on (positive score) and red for risk-off (negative score).
- I check the label in the lower-left corner, which provides specific FX pair recommendations and market expectations.
In a risk-on environment (positive score):
- I focus on long positions in AUD/JPY, NZD/JPY, EUR/USD, etc.
- I look for short opportunities in USD/CAD, USD/NOK, etc.
- I expect commodities and yields to rise
In a risk-off environment (negative score):
- I focus on long positions in USD/JPY, USD/CHF, USD/CAD
- I look for short opportunities in AUD/USD, NZD/USD, EUR/USD
- I expect increased volatility and falling yields
The strength of the sentiment is reflected in how close the score is to either 1 (strong risk-on) or -1 (strong risk-off). This helps me gauge how aggressive or conservative I should be with my Ichimoku trades.
Customisation
I've designed this indicator to be flexible. You can modify it to:
- Adjust the lookback period and moving average length (both default to 30)
- Change the weighting of different factors in the final score calculation
- Include or exclude specific factors based on your analysis needs
By combining this Macro Risk On/Off Sentiment Indicator with my Ichimoku analysis, I've found I can make more informed trading decisions, taking into account both the technical setups I see on the chart and the broader market context.
發行說明
New version removes the old educational labels which cluttered the script and replaces them with a real-time correlation score of the macro risk index vs the current symbol. A correlation of 1 means the symbol is moving in the same direction and proportion to the risk index, and a correlation of -1 means the opposite.Interestingly, the correlation score validates the earlier instructions that the macro risk score is positively correlated to equities and negatively correlated to safe havens.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。