OPEN-SOURCE SCRIPT

Fear and Greed Index [DunesIsland]

61
The Fear and Greed Index [DunesIsland] is a sentiment indicator designed to measure the emotions driving the stock market, specifically investor fear and greed. Fear represents pessimism and caution, while greed reflects optimism and risk-taking. This indicator aggregates multiple market metrics to provide a comprehensive view of market sentiment, helping traders and investors gauge whether the market is overly fearful or excessively greedy.How It WorksThe Fear and Greed Index is calculated using four key market indicators, each capturing a different aspect of market sentiment:

Market Momentum (30% weight)
  • Measures how the S&P 500 (SPX) is performing relative to its 125-day simple moving average (SMA).
  • A higher value indicates that the market is trading well above its moving average, signaling greed.

Stock Price Strength (20% weight)
  • Calculates the net number of stocks hitting 52-week highs minus those hitting 52-week lows on the NYSE.
  • A greater number of net highs suggests strong market breadth and greed.

Put/Call Options (30% weight)
  • Uses the 5-day average of the put/call ratio.
  • A lower ratio (more call options being bought) indicates greed, as investors are betting on rising prices.

Market Volatility (20% weight)
  • Utilizes the VIX index, which measures market volatility.
  • Lower volatility is associated with greed, as investors are less fearful of large market swings.

Each component is normalized using a z-score over a 252-day lookback period (approximately one trading year) and scaled to a range of 0 to 100. The final Fear and Greed Index is a weighted average of these four components, with the weights specified above.Key FeaturesIndex Range: The index value ranges from 0 to 100:
  • 0–25: Extreme Fear (red)
  • 25–50: Fear (orange)
  • 50–75: Neutral (yellow)
  • 75–100: Greed (green)

Dynamic Plot Color: The plot line changes color based on the index value, visually indicating the current sentiment zone.

Reference Lines: Horizontal lines are plotted at 0, 25, 50, 75, and 100 to represent the different sentiment levels: Extreme Fear, Fear, Neutral, Greed, and Extreme Greed.

How to Interpret
  • Low Values (0–25): Indicate extreme fear, which may suggest that the market is oversold and could be due for a rebound.
  • High Values (75–100): Indicate greed, which may signal that the market is overbought and could be at risk of a correction.
  • Neutral Range (25–75): Suggests a balanced market sentiment, neither overly fearful nor greedy.

This indicator is a valuable tool for contrarian investors, as extreme readings often precede market reversals. However, it should be used in conjunction with other technical and fundamental analysis tools for a well-rounded view of the market.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.