OPEN-SOURCE SCRIPT
Adil Hoca - US Market Score Only Nasdaq

Market Score & Crash Detector Indicator
User Guide & Usage Instructions
This TradingView indicator provides a comprehensive market risk assessment, combining multiple financial metrics to detect potential market crashes, recessions, and overall trend regimes. It is especially designed to alert traders and investors about early warning signals before significant market downturns, enabling proactive decision-making.
Key Features
Multi-Metric Market Sentiment: Uses volatility indices, currency strength, yield spreads, breadth, and bond ratios to evaluate market health.
Crash Detection System: Monitors various conditions such as VIX spikes, breadth collapse, momentum cliffs, high-yield spread surges, and hidden market weaknesses.
Reccession Indicator: Incorporates the Sahm Rule, a proven recession indicator based on employment data.
Alert System: Sends real-time alerts for critical market conditions, including crashes, recession signals, and spreads alerts.
Visual Elements: Includes histograms, trend lines, threshold lines, and shape signals to visually interpret market states.
Customizable Parameters: Adjust weights, sensitivity, thresholds, and alert preferences to suit your trading style.
How it Works
1. Data Collection
The indicator fetches data from multiple sources:
Market volatility: VIX index
Currency strength: DXY index
Interest rates: SOFR, PCE inflation
Yield spreads: High Yield Credit Spread, Investment Grade Spread
Market Breadth: Ratio of QQQ to TLT (tech vs. bonds)
Bond Ratios: TMF/TMV (long-term bonds)
Employment Data: The Sahm Rule (monthly unemployment data)
2. Normalization
Data is normalized via z-score calculations over defined periods to standardize the metrics, making them comparable regardless of their original scale.
3. Composite Score Calculation
Each metric is weighted according to user-defined parameters, and a composite score is generated to represent the overall market sentiment, smoothed with an EMA for trend clarity.
4. Crash & Recession Detection
Crash System: Looks for conditions like VIX spikes, breadth collapse, momentum drops, high yield spread surges, and hidden weaknesses. If multiple conditions meet thresholds, alerts trigger.
Recession Indicator: Uses the Sahm Rule, which compares the current unemployment rate's three-month average to the lowest point over the past 12 months. When it exceeds a certain threshold, a recession signal is generated.
5. Alerts & Visualization
Sound & Shape Alerts: Signals like warning triangles, cross icons, and color changes.
Threshold Lines: Indicate levels like "Strong Bullish," "Strong Bear," and critical zones.
Dual Confirmation: Combines crash and recession signals for high-confidence alerts.
Usage & Customization
Placing the Indicator
Copy and paste the Pine Script code into TradingView's Pine Editor.
Save and add the script to your chart. Adjust inputs like weights, sensitivity mode, thresholds, and alert preferences via the input panel.
Key Inputs
Weights: Customize the importance of each metric.
Sensitivity Mode: Changes alert thresholds for early warnings.
Crash Sensitivity: Defines how many indicators need to trigger before issuing a crash alert.
Recession Thresholds: Set the unemployment level that signals recession.
Interpreting Visuals
Histogram: Shows the composite score; green means bullish, red indicates bearish.
Momentum Line: Highlights trend acceleration/deceleration.
Threshold Lines: Dotted/dashed lines showing critical zones.
Shape Shapes: Triangles or crosses appear for early signals or critical events.
Alerts
Crash Alerts: Warn of imminent market crashes.
Recession Alerts: Indicate economic downturns based on Sahm Rule.
Spread Alerts: Show high-yield credit spread surges signaling stress.
Double Confirmation: High-confidence signals when crash and recession conditions align.
Best Practices
Use on multiple timeframes for confirmation.
Combine with other technical analysis tools for better accuracy.
Adjust thresholds according to your risk appetite.
Follow alert signals for early warning but always consider overall context.
Final Notes
This indicator synthesizes a variety of leading and lagging indicators to give a holistic view of market health. It is designed to provide early warnings, especially in volatile or stressed environments, helping traders avoid severe drawdowns or position ahead of major downturns.
Feel free to modify input parameters for your preferences, or integrate additional data sources for further refinement.
This detailed explanation can be directly included as a description or documentation within your TradingView script, helping users grasp its full capabilities and optimal usage.
User Guide & Usage Instructions
This TradingView indicator provides a comprehensive market risk assessment, combining multiple financial metrics to detect potential market crashes, recessions, and overall trend regimes. It is especially designed to alert traders and investors about early warning signals before significant market downturns, enabling proactive decision-making.
Key Features
Multi-Metric Market Sentiment: Uses volatility indices, currency strength, yield spreads, breadth, and bond ratios to evaluate market health.
Crash Detection System: Monitors various conditions such as VIX spikes, breadth collapse, momentum cliffs, high-yield spread surges, and hidden market weaknesses.
Reccession Indicator: Incorporates the Sahm Rule, a proven recession indicator based on employment data.
Alert System: Sends real-time alerts for critical market conditions, including crashes, recession signals, and spreads alerts.
Visual Elements: Includes histograms, trend lines, threshold lines, and shape signals to visually interpret market states.
Customizable Parameters: Adjust weights, sensitivity, thresholds, and alert preferences to suit your trading style.
How it Works
1. Data Collection
The indicator fetches data from multiple sources:
Market volatility: VIX index
Currency strength: DXY index
Interest rates: SOFR, PCE inflation
Yield spreads: High Yield Credit Spread, Investment Grade Spread
Market Breadth: Ratio of QQQ to TLT (tech vs. bonds)
Bond Ratios: TMF/TMV (long-term bonds)
Employment Data: The Sahm Rule (monthly unemployment data)
2. Normalization
Data is normalized via z-score calculations over defined periods to standardize the metrics, making them comparable regardless of their original scale.
3. Composite Score Calculation
Each metric is weighted according to user-defined parameters, and a composite score is generated to represent the overall market sentiment, smoothed with an EMA for trend clarity.
4. Crash & Recession Detection
Crash System: Looks for conditions like VIX spikes, breadth collapse, momentum drops, high yield spread surges, and hidden weaknesses. If multiple conditions meet thresholds, alerts trigger.
Recession Indicator: Uses the Sahm Rule, which compares the current unemployment rate's three-month average to the lowest point over the past 12 months. When it exceeds a certain threshold, a recession signal is generated.
5. Alerts & Visualization
Sound & Shape Alerts: Signals like warning triangles, cross icons, and color changes.
Threshold Lines: Indicate levels like "Strong Bullish," "Strong Bear," and critical zones.
Dual Confirmation: Combines crash and recession signals for high-confidence alerts.
Usage & Customization
Placing the Indicator
Copy and paste the Pine Script code into TradingView's Pine Editor.
Save and add the script to your chart. Adjust inputs like weights, sensitivity mode, thresholds, and alert preferences via the input panel.
Key Inputs
Weights: Customize the importance of each metric.
Sensitivity Mode: Changes alert thresholds for early warnings.
Crash Sensitivity: Defines how many indicators need to trigger before issuing a crash alert.
Recession Thresholds: Set the unemployment level that signals recession.
Interpreting Visuals
Histogram: Shows the composite score; green means bullish, red indicates bearish.
Momentum Line: Highlights trend acceleration/deceleration.
Threshold Lines: Dotted/dashed lines showing critical zones.
Shape Shapes: Triangles or crosses appear for early signals or critical events.
Alerts
Crash Alerts: Warn of imminent market crashes.
Recession Alerts: Indicate economic downturns based on Sahm Rule.
Spread Alerts: Show high-yield credit spread surges signaling stress.
Double Confirmation: High-confidence signals when crash and recession conditions align.
Best Practices
Use on multiple timeframes for confirmation.
Combine with other technical analysis tools for better accuracy.
Adjust thresholds according to your risk appetite.
Follow alert signals for early warning but always consider overall context.
Final Notes
This indicator synthesizes a variety of leading and lagging indicators to give a holistic view of market health. It is designed to provide early warnings, especially in volatile or stressed environments, helping traders avoid severe drawdowns or position ahead of major downturns.
Feel free to modify input parameters for your preferences, or integrate additional data sources for further refinement.
This detailed explanation can be directly included as a description or documentation within your TradingView script, helping users grasp its full capabilities and optimal usage.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
English-only community for international traders:
📍 US Market Commentary EN (link below)
🔗 Join our X Community: x.com/i/communities/1911416510351814777
💡 Pine Script indicators, setups & real-time alerts
📍 US Market Commentary EN (link below)
🔗 Join our X Community: x.com/i/communities/1911416510351814777
💡 Pine Script indicators, setups & real-time alerts
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
English-only community for international traders:
📍 US Market Commentary EN (link below)
🔗 Join our X Community: x.com/i/communities/1911416510351814777
💡 Pine Script indicators, setups & real-time alerts
📍 US Market Commentary EN (link below)
🔗 Join our X Community: x.com/i/communities/1911416510351814777
💡 Pine Script indicators, setups & real-time alerts
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。