Smart Fear & Greed Index [MarkitTick]💡 This comprehensive technical tool is designed to quantify market sentiment on an asset-specific basis, translating complex price action into a singular, normalized gauge of "Fear" and "Greed." While traditional Fear & Greed indices rely on macro-economic data (like put/call ratios or junk bond demand) generally applied to the broad S&P 500, this script calculates a localized index for the specific chart you are viewing. It synthesizes Momentum, Volatility, Volume, and Price Positioning into a bounded 0-100 oscillator, aiming to identify psychological extremes where market reversals are statistically more likely to occur.
✨ Originality and Utility
● Asset-Specific Sentiment Analysis
Most sentiment tools are external to the chart (e.g., news sentiment or broad market indices). The Smart Fear & Greed Index is unique because it internalizes this logic, creating a bespoke psychological profile for any ticker—whether it is Crypto, Forex, or Stocks. It allows traders to see if *this specific asset* is overheated (Greed) or oversold (Fear) relative to its own recent history.
● The "Buy the Fear, Sell the Greed" Logic
The script employs a contrarian color-coding philosophy aligned with the famous investment adage: "Be fearful when others are greedy, and greedy when others are fearful."
When the indicator shows Fear (Low values), it colors the zone Green, signaling a potential buying opportunity (discount).
When the indicator shows Greed (High values), it colors the zone Red, signaling potential downside risk (premium).
● Integrated Divergence Detection
Unlike standard oscillators that leave interpretation entirely to the user, this tool includes an automated divergence engine. It detects discrepancies between the sentiment index and price action, plotting lines and labels to highlight potential exhaustion points before they become obvious on the price chart.
🔬 Methodology and Concepts
The calculation is driven by a custom User-Defined Type (UDT) called QuantEngine , which aggregates four distinct technical "pillars" to form the final Composite Index.
• Pillar 1: Momentum (RSI)
The engine utilizes the Relative Strength Index to measure the velocity and magnitude of directional price movements. High momentum contributes to the "Greed" score, while collapsing momentum contributes to "Fear."
• Pillar 2: Volatility (Inverted Normalized ATR)
This component interprets volatility through a psychological lens.
Low Volatility is interpreted as complacency or "Greed" (steady uptrends often have low vol).
High Volatility is interpreted as "Fear" (panic selling and erratic ranges often spike volatility).
The script normalizes the Average True Range (ATR) and inverts it so that stability adds to the score, and instability subtracts from it.
• Pillar 3: Volume Strength
Volume is analyzed relative to its moving average. However, raw volume isn't enough; the engine applies directional logic.
High relative volume on an Up-Close adds to the Greed score.
High relative volume on a Down-Close subtracts, adding to the Fear score.
• Pillar 4: Price Position (Stochastic)
This calculates where the current close sits relative to the recent High-Low range. Closing near the highs indicates confidence (Greed), while closing near the lows indicates pessimism (Fear).
• The Composite & Smoothing
These four metrics are averaged to create a raw composite, which is then smoothed via an Exponential Moving Average (EMA) to filter out noise and produce the final, readable "Smart Fear & Greed" line.
🎨 Visual Guide
● The Oscillator Line
This is the primary fluctuating line that moves between 0 and 100.
Values > 50 suggest positive sentiment.
Values < 50 suggest negative sentiment.
● Color-Coded Zones
The plot changes color dynamically to reflect the psychological state:
Red (70-100): Extreme Greed. The market may be irrationally exuberant.
Orange (60-70): Greed. Strong bullish conviction.
Yellow (40-60): Neutral. Indecisive or transitionary market.
Light Green (30-40): Fear. Sentiment is turning bearish.
Bright Green (0-30): Extreme Fear. Panic selling, often a precursor to a value bounce.
● Background Highlights
A semi-transparent Red Background appears when the index breaches 75, warning of a potential "Top."
A semi-transparent Green Background appears when the index drops below 25, highlighting a potential "Bottom."
● Divergence Elements
Red Lines/Labels ("Bear"): Bearish Divergence. Price makes a Higher High, but the Index makes a Lower High. This suggests momentum is waning despite rising prices.
Green Lines/Labels ("Bull"): Bullish Divergence. Price makes a Lower Low, but the Index makes a Higher Low. This suggests selling pressure is drying up.
📖 How to Use
• Identifying Reversals
Wait for the oscillator to enter "Extreme" zones. Do not trade immediately upon entry; wait for the line to exit the extreme zone to confirm the reversal. For example, if the line hits 80 (Red) and then crosses back down below 70, it signals that Greed is fading.
• Trend Continuation
In a strong trend, the indicator may hover in the Greed (Orange) or Fear (Light Green) zones for extended periods. In these cases, use the Neutral (Yellow) zone crosses as re-entry signals in the direction of the trend.
• Divergence Confirmation
Use the automated divergence lines as high-conviction triggers. If the background turns Green (Extreme Fear) AND a Bullish Divergence label appears, it provides a stronger technical case for a long position than the zone alone.
⚙️ Inputs and Settings
● Calculation Settings
Global Lookback Period (Default: 21): The core lookback window for RSI, ATR, Volume, and Stochastic calculations. Increasing this makes the index slower and less reactive; decreasing it makes it faster.
Smoothing Length (Default: 5): Determines how smooth the final line is. Higher numbers reduce "whipsaws" but add lag.
Color Main Chart Candles : Colors the chart bars based on Fear/Greed sentiment.
● Divergence Settings
Divergence Lookback (Default: 5): Determines the pivot strength required to register a high or low for divergence checks.
Show Divergence Lines/Labels: Toggles to hide visual clutter if you only want to see the oscillator.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Normalization Theory
The core scientific principle here is Min-Max Normalization. The script takes heterogeneous data types—Price (Dollars/Cents), Volume (Shares/Contracts), and Volatility (Points)—and standardizes them into a unit-less distribution between 0 and 100. This allows for the summation of disparate market forces into a single vector.
● Mean Reversion and Oscillator Bounds
The indicator relies on the statistical concept of Mean Reversion. Markets, like elastic bands, can only stretch so far from their average valuation (represented by the 50 line) before snapping back. The "Extreme" zones (Upper and Lower deciles) represent areas of statistical improbability where the likelihood of a continuation decreases and the likelihood of a reversion increases.
● Divergence and Momentum Theory
The divergence logic is grounded in the principle that momentum precedes price. Mathematically, price is the integral of velocity. When the derivative (momentum/sentiment) approaches zero or reverses while the function (price) continues, it signals a non-sustainable anomaly in the data series, often resolved by a price correction.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
Greed-indicator
FEAR & GREED INDICATORBINANCE:BTCUSDTPERP
Hello
The crypto index, which is currently only for Bitcoin, captures bearish and bullish trends by gauging investor sentiment for the coin. As the name suggests, the market trend is identified based on two emotions – fear and greed.
This configurations are set for 1D BTC charts
This is simple script, based on cheatcountry script
Enjoy ;)

