Fear & Greed Index CNN-like

Fear & Greed Index Line v2 (based on Zeiierman)
This indicator rebuilds the CNN Fear & Greed Index directly on your TradingView chart as a single 0–100 sentiment line. Version 2 closely follows CNN's published methodology. It combines seven market signals, scores each one against its own recent history and averages them into one reading.
The seven components:
1. Market Momentum: the S&P 500 vs. its 125-day moving average (SP:SPX)
2. Stock Price Strength: NYSE 52-week highs vs. 52-week lows (INDEX:MAHN / INDEX:MALN)
3. Stock Price Breadth: the McClellan Volume Summation Index from NYSE up and down volume (USI:UVOL / USI:DVOL)
4. Put/Call Options: the 5-day average CBOE put/call ratio (USI:PCC); higher means more fear
5. Junk Bond Demand: high-yield vs. investment-grade bonds (AMEX:HYG / AMEX:LQD), or optionally the ICE BofA US High Yield OAS (FRED:BAMLH0A0HYM2)
6. Market Volatility: the VIX vs. its 50-day moving average (CBOE:VIX); higher means more fear
7. Safe Haven Demand: the 20-day return of stocks vs. Treasuries (SP:SPX vs. NASDAQ:IEF)
How it works
Each component is scored from 0 to 100 against a rolling window of 252 trading days, about one year. You can choose between two scoring methods. Z-Score Logistic is the default and maps standardized deviations onto a smooth curve. Percentile Rank ranks the current value within the window. The weighted average of all available components forms the composite line. If a data feed is missing, that component is skipped and the indicator keeps running.
All data is requested on the daily timeframe with lookahead off, so confirmed values don't repaint. The value is the same on any chart, because it measures overall US equity market sentiment rather than the symbol you are viewing.
Zones (CNN scale)
- 0–25: Extreme Fear
- 25–45: Fear
- 45–55: Neutral
- 55–75: Greed
- 75–100: Extreme Greed
Features
- A color-coded composite line with a live value label
- Background zones and a zone legend
- A dashboard table showing each component's score and sentiment
- Optional individual component lines
- Adjustable lookback, scoring method, logistic steepness, smoothing and per-component weights (set a weight to 0 to disable that component)
- Alerts for entering and leaving Extreme Fear and Extreme Greed
What changed from v1
v1 scaled nominal point differences over the entire chart history and used simplified proxies for strength, breadth, credit and safe-haven demand. v2 uses percentage-based inputs, a rolling one-year normalization, the actual NYSE new highs/lows and volume breadth data, and correct polarity for the credit spread. In testing against CNN's published data, the scoring method reproduced CNN's reading within a few points.
Notes
TradingView has no direct access to some of CNN's sources, such as exact corporate bond yield spreads, so ETF proxies are used and small differences from CNN's value are expected. This indicator is a sentiment tool, not a trading signal on its own. It is for educational purposes only and is not financial advice.
Credits
The original concept and code base are by Zeiierman. v2 is a recalibrated rework in Pine Script v6. Licensed under CC BY-NC-SA 4.0.
This indicator rebuilds the CNN Fear & Greed Index directly on your TradingView chart as a single 0–100 sentiment line. Version 2 closely follows CNN's published methodology. It combines seven market signals, scores each one against its own recent history and averages them into one reading.
The seven components:
1. Market Momentum: the S&P 500 vs. its 125-day moving average (SP:SPX)
2. Stock Price Strength: NYSE 52-week highs vs. 52-week lows (INDEX:MAHN / INDEX:MALN)
3. Stock Price Breadth: the McClellan Volume Summation Index from NYSE up and down volume (USI:UVOL / USI:DVOL)
4. Put/Call Options: the 5-day average CBOE put/call ratio (USI:PCC); higher means more fear
5. Junk Bond Demand: high-yield vs. investment-grade bonds (AMEX:HYG / AMEX:LQD), or optionally the ICE BofA US High Yield OAS (FRED:BAMLH0A0HYM2)
6. Market Volatility: the VIX vs. its 50-day moving average (CBOE:VIX); higher means more fear
7. Safe Haven Demand: the 20-day return of stocks vs. Treasuries (SP:SPX vs. NASDAQ:IEF)
How it works
Each component is scored from 0 to 100 against a rolling window of 252 trading days, about one year. You can choose between two scoring methods. Z-Score Logistic is the default and maps standardized deviations onto a smooth curve. Percentile Rank ranks the current value within the window. The weighted average of all available components forms the composite line. If a data feed is missing, that component is skipped and the indicator keeps running.
All data is requested on the daily timeframe with lookahead off, so confirmed values don't repaint. The value is the same on any chart, because it measures overall US equity market sentiment rather than the symbol you are viewing.
Zones (CNN scale)
- 0–25: Extreme Fear
- 25–45: Fear
- 45–55: Neutral
- 55–75: Greed
- 75–100: Extreme Greed
Features
- A color-coded composite line with a live value label
- Background zones and a zone legend
- A dashboard table showing each component's score and sentiment
- Optional individual component lines
- Adjustable lookback, scoring method, logistic steepness, smoothing and per-component weights (set a weight to 0 to disable that component)
- Alerts for entering and leaving Extreme Fear and Extreme Greed
What changed from v1
v1 scaled nominal point differences over the entire chart history and used simplified proxies for strength, breadth, credit and safe-haven demand. v2 uses percentage-based inputs, a rolling one-year normalization, the actual NYSE new highs/lows and volume breadth data, and correct polarity for the credit spread. In testing against CNN's published data, the scoring method reproduced CNN's reading within a few points.
Notes
TradingView has no direct access to some of CNN's sources, such as exact corporate bond yield spreads, so ETF proxies are used and small differences from CNN's value are expected. This indicator is a sentiment tool, not a trading signal on its own. It is for educational purposes only and is not financial advice.
Credits
The original concept and code base are by Zeiierman. v2 is a recalibrated rework in Pine Script v6. Licensed under CC BY-NC-SA 4.0.
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน