OPEN-SOURCE SCRIPT

Composite Risk Indicator

已更新
The Composite Risk Indicator is a financial tool designed to assess market risk by analyzing the spreads between various asset classes. This indicator synthesizes information across six key spreads, normalizing each on a scale from 0 to 100 where higher values represent higher perceived risk. It provides a single, comprehensive measure of market sentiment and risk exposure.

Key Components of the CRI:
1. Stock Market to Bond Market Spread (SPY/BND): Measures the performance of stocks relative to bonds. Higher values indicate stronger stock performance compared to bonds, suggesting increased market optimism and higher risk.
2. Junk Bond to Treasury Bond Spread (HYG/GOVT): Assesses the performance of high-yield (riskier) bonds relative to government (safer) bonds. A higher ratio indicates increased appetite for risk.
3. Junk Bond to Investment Grade Bond Spread (HYG/LQD): Compares high-yield bonds to investment-grade corporate bonds. This ratio sheds light on the risk tolerance within the corporate bond market.
4. Growth to Value Spread (VUG/VTV): Evaluates the performance of growth stocks against value stocks. A higher value suggests a preference for growth stocks, often seen in risk-on environments.
5. Tech to Staples Spread (XLK/XLP): Measures the performance of technology stocks relative to consumer staples. This ratio highlights the market’s risk preference within equity sectors.
6. Small Cap Growth to Small Cap Value Spread (SLYG/SLYV): Compares small-cap growth stocks to small-cap value stocks, providing insight into risk levels in smaller companies.

Utility:
This indicator is particularly useful for investors and traders looking to gauge market sentiment, identify shifts in risk appetite, and make informed decisions based on a broad assessment of market conditions. The CRI can serve as a valuable addition to investment analysis and risk management strategies.
版本注释
Composite Risk Indicator (CRI)
The Composite Risk Indicator is a sophisticated tool designed to assess market risk by analyzing the spreads between various asset classes, now including key currency pairs. This indicator synthesizes information from multiple domains—equities, bonds, and currencies—normalizing each on a scale from 0 to 100, where higher values represent higher perceived risk. It provides a comprehensive measure of market sentiment and risk exposure.

Key Components of the CRI:

Equities and Bonds:
Stock Market to Bond Market Spread (SPY/BND): Measures the performance of stocks relative to bonds, indicating market optimism and risk levels.
Junk Bond to Treasury Bond Spread (HYG/GOVT) and Junk Bond to Investment Grade Bond Spread (HYG/LQD): Reflect the market's risk tolerance within the bond sector.
Growth to Value Spread (VUG/VTV): Evaluates the preference for growth stocks versus value stocks.
Tech to Staples Spread (XLK/XLP): Highlights risk preferences within equity sectors.
Small Cap Growth to Small Cap Value Spread (SLYG/SLYV): Provides insight into risk levels in smaller companies.

Currencies:
Australian Dollar to Japanese Yen (FXA/FXY): This spread offers insights into risk sentiment between growth-oriented and safe-haven currencies.
Australian Dollar to US Dollar (FXA/UUP): Measures the performance of a growth-linked currency against the world's reserve currency, reflecting broader economic trends.

Utility:
This indicator is particularly useful for investors and traders looking to gauge overall market sentiment, identify shifts in risk appetite, and make informed decisions based on a broad assessment of market conditions. It serves as a valuable addition to investment analysis and risk management strategies, offering insights not just from traditional stocks and bonds but also from the forex market.
版本注释
Added a High Beta to Low Beta spread component.
版本注释
Added the following to the index:

SPY/VIX spread
AUD(FXA)/JPY(FXY)
AUD(FXA)/USD(UUP)
版本注释
Removed SLYG/SLV ratio

Added IWM/SPY ratio
Added XLY/XLP ratio
Added IYT/DIA ratio
版本注释
Added grid lines on the index chart to show areas of

Extreme Risk Off 0-25
Risk Off 25-45
Neutral 45-55
Risk On 55-75
Extreme Risk On 75-100
版本注释
Removed due to redundancy in data
-XLK/XLP
-XLY/XLP

Converted FX pairs to respective currency pairs and not the proxy ETFs

From FXA/FXY to AUDJPY
From FXA/UUP to AUDUSD
版本注释
Minor code fix
版本注释
Removed any asset pair with a correlation threshold < .3
Which included
(IWM/SPY)
(IYT/DIA)
(RSP/SPY)

The elimination of "noisy" asset pairs improves the reliability of the indicator for visualizing "Risk On" vs. "Risk Off" periods.
sentimentstatisticsVolatility

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明