OPEN-SOURCE SCRIPT

Candle Emotion Index (CEI)

The Candle Emotion Index (CEI) is a comprehensive sentiment analysis indicator that combines three sub-oscillators—Indecision Oscillator, Fear Oscillator, and Greed Oscillator—to provide a single, unified measure of market sentiment. By analyzing bullish, bearish, and indecisive candlestick patterns, the CEI delivers a holistic view of market emotions and helps traders identify key turning points.

How It Works
Indecision Oscillator: Measures market uncertainty using Doji and Spinning Top candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Fear Oscillator: Measures bearish sentiment using Shooting Star, Hanging Man, and Bearish Engulfing candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Greed Oscillator: Measures bullish sentiment using Marubozu, Bullish Engulfing, Hammer, and Three White Soldiers candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Candle Emotion Index Calculation: The CEI is calculated as the average of the Indecision, Fear, and Greed Oscillators: CEI = (Indecision Oscillator + Fear Oscillator + Greed Oscillator) / 3
Plotting: The CEI is plotted as a single line on the chart, representing overall market sentiment.
Reference lines are added to indicate Low Emotion, Neutral, and High Emotion levels.

The Candle Emotion Index provides a unified perspective on market sentiment by blending indecision, fear, and greed into one easy-to-interpret metric. It serves as a powerful tool for traders seeking to gauge market psychology and identify high-probability trading opportunities. For best results, use the CEI in conjunction with other technical indicators to confirm signals.

Feragatname