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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。