OPEN-SOURCE SCRIPT
Composite Fear & Greed Index

Composite Fear & Greed Index
This is an advanced, professional-grade sentiment analysis engine designed to quantify market psychology. Unlike standard oscillators that rely on a single metric, this script uses a weighted composite of four distinct technical components to generate a holistic "Fear & Greed" score.
It includes Multi-Timeframe (MTF) capabilities, proprietary FOMO/Panic detection logic, and Zero-Lag trend analysis.
1. Unique Mathematical Methodology
This script is not a simple overlay of existing indicators. It uses a Composite Normalization Engine to blend four distinct metrics into a single, bounded 0-100 oscillator.
The "Mashup" Problem Solved: Standard indicators like MACD are "unbounded" (they can go to infinity), while RSI is "bounded" (0-100). You cannot simply average them.
Our Solution: This script calculates the Z-Score of the MACD histogram relative to its historical deviation and normalizes it into a 0-100 percentile. This allows for a mathematically valid combination with RSI and Bollinger Bands.
The Component Logic:
Momentum (RSI): (Weight: 30%) Pure price velocity.
Volatility (Bollinger %B): (Weight: 25%) Relative position within volatility bands.
Trend Strength (Normalized MACD): (Weight: 25%) Uses the custom Z-Score logic described above.
Trend Integrity (ZLEMA): (Weight: 20%) We replaced the standard SMA with a custom Zero-Lag Exponential Moving Average (ZLEMA) algorithm. This removes the "lag" associated with traditional sentiment analysis, allowing the index to react to crypto volatility in real-time.
The Calculation: These raw values are weighted and smoothed to produce the final Index Value.
Greater than 80: Extreme Greed (High risk of reversal)
Less than 20: Extreme Fear (Potential accumulation zone)
2. Unique Features
A. FOMO & Panic Event Detection The script does not just track price; it tracks behavior.
FOMO (Fear Of Missing Out): Triggered when Price breaks the Upper Bollinger Band + RSI is Overbought + Volume spikes > 2.5x the average. This often marks local tops.
PANIC: Triggered when Price drops significantly in one bar + Volume spikes > 3.0x the average + RSI is Oversold. This often marks capitulation bottoms.
B. Divergence Detection The script automatically detects and plots Regular Bullish and Bearish divergences between Price and the Sentiment Index.
Bullish Divergence: Price makes a Lower Low, but Sentiment makes a Higher Low (indicating waning selling pressure).
Bearish Divergence: Price makes a Higher High, but Sentiment makes a Lower High (indicating waning buying pressure). Note: The script plots these signals precisely on the indicator line corresponding to the pivot point.
C. Multi-Timeframe (MTF) Engine Users can view the "Daily" sentiment score while trading on a 5-minute or 15-minute chart. This allows scalpers to align their trades with the higher-timeframe market psychology.
3. Usage Guide
Step 1: Trend Alignment Look at the dashboard or the main line color. Green indicates Greed/Uptrend, Red indicates Fear/Downtrend.
Step 2: Extremes
Sell/Take Profit: When the Index crosses 80 (Extreme Greed) or a "FOMO" triangle appears.
Buy/Long: When the Index crosses 20 (Extreme Fear) or a "PANIC" triangle appears.
Step 3: Confirmation Use the Divergence Dots as confirmation. A "Panic" signal followed by a "Bullish Divergence" dot is a high-probability reversal setup.
Settings
Timeframe: Select the MTF resolution (default is Chart).
Weights: You can adjust the influence of RSI, MACD, BB, or Trend to fit your specific asset class.
Visuals: Fully customizable colors, table position, and toggle switches for shapes/backgrounds.
Disclaimer: This script is for informational purposes only and does not constitute financial advice.
This is an advanced, professional-grade sentiment analysis engine designed to quantify market psychology. Unlike standard oscillators that rely on a single metric, this script uses a weighted composite of four distinct technical components to generate a holistic "Fear & Greed" score.
It includes Multi-Timeframe (MTF) capabilities, proprietary FOMO/Panic detection logic, and Zero-Lag trend analysis.
1. Unique Mathematical Methodology
This script is not a simple overlay of existing indicators. It uses a Composite Normalization Engine to blend four distinct metrics into a single, bounded 0-100 oscillator.
The "Mashup" Problem Solved: Standard indicators like MACD are "unbounded" (they can go to infinity), while RSI is "bounded" (0-100). You cannot simply average them.
Our Solution: This script calculates the Z-Score of the MACD histogram relative to its historical deviation and normalizes it into a 0-100 percentile. This allows for a mathematically valid combination with RSI and Bollinger Bands.
The Component Logic:
Momentum (RSI): (Weight: 30%) Pure price velocity.
Volatility (Bollinger %B): (Weight: 25%) Relative position within volatility bands.
Trend Strength (Normalized MACD): (Weight: 25%) Uses the custom Z-Score logic described above.
Trend Integrity (ZLEMA): (Weight: 20%) We replaced the standard SMA with a custom Zero-Lag Exponential Moving Average (ZLEMA) algorithm. This removes the "lag" associated with traditional sentiment analysis, allowing the index to react to crypto volatility in real-time.
The Calculation: These raw values are weighted and smoothed to produce the final Index Value.
Greater than 80: Extreme Greed (High risk of reversal)
Less than 20: Extreme Fear (Potential accumulation zone)
2. Unique Features
A. FOMO & Panic Event Detection The script does not just track price; it tracks behavior.
FOMO (Fear Of Missing Out): Triggered when Price breaks the Upper Bollinger Band + RSI is Overbought + Volume spikes > 2.5x the average. This often marks local tops.
PANIC: Triggered when Price drops significantly in one bar + Volume spikes > 3.0x the average + RSI is Oversold. This often marks capitulation bottoms.
B. Divergence Detection The script automatically detects and plots Regular Bullish and Bearish divergences between Price and the Sentiment Index.
Bullish Divergence: Price makes a Lower Low, but Sentiment makes a Higher Low (indicating waning selling pressure).
Bearish Divergence: Price makes a Higher High, but Sentiment makes a Lower High (indicating waning buying pressure). Note: The script plots these signals precisely on the indicator line corresponding to the pivot point.
C. Multi-Timeframe (MTF) Engine Users can view the "Daily" sentiment score while trading on a 5-minute or 15-minute chart. This allows scalpers to align their trades with the higher-timeframe market psychology.
3. Usage Guide
Step 1: Trend Alignment Look at the dashboard or the main line color. Green indicates Greed/Uptrend, Red indicates Fear/Downtrend.
Step 2: Extremes
Sell/Take Profit: When the Index crosses 80 (Extreme Greed) or a "FOMO" triangle appears.
Buy/Long: When the Index crosses 20 (Extreme Fear) or a "PANIC" triangle appears.
Step 3: Confirmation Use the Divergence Dots as confirmation. A "Panic" signal followed by a "Bullish Divergence" dot is a high-probability reversal setup.
Settings
Timeframe: Select the MTF resolution (default is Chart).
Weights: You can adjust the influence of RSI, MACD, BB, or Trend to fit your specific asset class.
Visuals: Fully customizable colors, table position, and toggle switches for shapes/backgrounds.
Disclaimer: This script is for informational purposes only and does not constitute financial advice.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.