Downloading...
OPEN-SOURCE SCRIPT
Updated

Fear and Greed Indicator [DunesIsland]

295
The Fear and Greed Indicator [DunesIsland] is a TradingView indicator that measures market sentiment using five metrics. It displays:
  • Tiny green circles below candles when the market is in "Extreme Fear" (index ≤ 25), signalling potential buys.
  • Tiny red circles above candles when the market is in "Greed" (index > 75), indicating potential sells.


Purpose: Helps traders spot market extremes for contrarian trading opportunities.Components (each weighted 20%):
  • Market Momentum: S&P 500 (SPX) vs. its 125-day SMA, normalized over 252 days.
  • Stock Price Strength: Net NYSE 52-week highs (INDEX:HIGN) minus lows (INDEX:LOWN), normalized.
  • Put/Call Ratio: 5-day SMA of Put/Call Ratio (USI:PC).
  • Market Volatility: VIX (VIX), inverted and normalized.
  • Stochastic RSI: 14-period RSI on SPX with 3-period Stochastic SMA.


Alerts:
  • Buy: Index ≤ 25 ("Extreme Fear - Potential Buy").
  • Sell: Index > 75 ("Greed - Potential Sell").


Release Notes
The updated script includes several key improvements, making it more accurate and user-friendly:
  • Smarter Shape Plotting: In the original script, circles might have appeared on every bar where the fear or greed condition was met, cluttering the chart. Now, circles are only plotted at the start of a new fear or greed period, clearly marking the moment to consider a buy or sell opportunity.
  • Improved Line Persistence: Previously, if the condition was met for just one bar, the horizontal line might not have displayed correctly. The updated version ensures that the line extends for a total of 5 bars (including the trigger bar), providing consistent visual feedback even for short-lived signals.
  • Better Retrigger Handling: The original script struggled with retriggers—when the condition was met, unmet, and met again in quick succession. Now, the script dynamically adjusts: for example, if the condition triggers on one bar, stops, and triggers again later, the line starts at the first trigger’s close and extends for 5 bars after the last trigger. This ensures the indicator accurately reflects evolving market sentiment.


These changes make the Fear and Greed Indicator more reliable and easier to read, offering clearer signals for potential trading opportunities.

Release Notes
Updated Chart

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.