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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.