OPEN-SOURCE SCRIPT
Business Cycle Composite [v6]

The Business Cycle Composite is a macro oscillator that aggregates ten independently scored economic signals into a single weighted composite, designed to identify where the U.S. economy currently stands within the four classical cycle phases: Expansion, Late Cycle, Contraction, and Trough.
Each signal is normalized to a −1 to +1 scale before being weighted and combined. The yield curve (10Y−2Y spread) carries the highest weight at 18%, reflecting its historically reliable recession-forecasting track record. Credit market health is captured through the HYG/LQD ratio (15%), while Fed Funds trend, CPI momentum, consumer sentiment, risk appetite (XLY/XLP), and housing permits each contribute between 8–10%. The Copper/Gold ratio and the Sahm Rule unemployment trigger round out the composite at lower weights, serving as real-economy confirmation signals. The final score is smoothed with a configurable EMA and requires a minimum number of consecutive bars before a phase transition is confirmed, reducing noise-driven whipsaws.
The resulting oscillator crosses four threshold zones. A score above +0.35 signals Expansion — broad macro conditions are supportive of risk assets. Between zero and +0.35 the indicator reads Late Cycle, characterized by tightening conditions and fading momentum. Below zero but above −0.30 marks Contraction, where recessionary pressure is building. Below −0.30 the indicator enters the Trough phase, historically the zone where forward-looking assets begin to bottom ahead of the real economy.
The indicator plots both the smoothed composite and the underlying raw score, with color-coded phase backgrounds for instant visual context. A dashboard table in the top-right corner shows the current phase label, composite score, Sahm Rule status, and individual signal readings with a simple bar-style strength display. Five built-in alert conditions notify on every phase transition, including a dedicated Sahm Rule trigger alert.
All data is pulled automatically from FRED and standard U.S. equity ETFs. The indicator is best used on the weekly chart. All weights and thresholds are fully adjustable via the settings panel. For educational purposes only — not financial advice.
Each signal is normalized to a −1 to +1 scale before being weighted and combined. The yield curve (10Y−2Y spread) carries the highest weight at 18%, reflecting its historically reliable recession-forecasting track record. Credit market health is captured through the HYG/LQD ratio (15%), while Fed Funds trend, CPI momentum, consumer sentiment, risk appetite (XLY/XLP), and housing permits each contribute between 8–10%. The Copper/Gold ratio and the Sahm Rule unemployment trigger round out the composite at lower weights, serving as real-economy confirmation signals. The final score is smoothed with a configurable EMA and requires a minimum number of consecutive bars before a phase transition is confirmed, reducing noise-driven whipsaws.
The resulting oscillator crosses four threshold zones. A score above +0.35 signals Expansion — broad macro conditions are supportive of risk assets. Between zero and +0.35 the indicator reads Late Cycle, characterized by tightening conditions and fading momentum. Below zero but above −0.30 marks Contraction, where recessionary pressure is building. Below −0.30 the indicator enters the Trough phase, historically the zone where forward-looking assets begin to bottom ahead of the real economy.
The indicator plots both the smoothed composite and the underlying raw score, with color-coded phase backgrounds for instant visual context. A dashboard table in the top-right corner shows the current phase label, composite score, Sahm Rule status, and individual signal readings with a simple bar-style strength display. Five built-in alert conditions notify on every phase transition, including a dedicated Sahm Rule trigger alert.
All data is pulled automatically from FRED and standard U.S. equity ETFs. The indicator is best used on the weekly chart. All weights and thresholds are fully adjustable via the settings panel. For educational purposes only — not financial advice.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。