Candle Emotion Index (CEI) StrategyThe Candle Emotion Index (CEI) Strategy is an innovative sentiment-based trading approach designed to help traders identify and capitalize on market psychology. By analyzing candlestick patterns and combining them into a unified metric, the CEI Strategy provides clear entry and exit signals while dynamically managing risk. This strategy is ideal for traders looking to leverage market sentiment to identify high-probability trading opportunities.
How It Works
The CEI Strategy is built around three core oscillators that reflect key emotional states in the market:
Indecision Oscillator . Measures market uncertainty using patterns like Doji and Spinning Tops. High values indicate hesitation, signaling potential turning points.
Fear Oscillator . Tracks bearish sentiment through patterns like Shooting Star, Hanging Man, and Bearish Engulfing. Helps identify moments of intense selling pressure.
Greed Oscillator . Detects bullish sentiment using patterns like Marubozu, Hammer, Bullish Engulfing, and Three White Soldiers. Highlights periods of strong buying interest.
These oscillators are averaged into the Candle Emotion Index (CEI):
CEI = (Indecision + Fear + Greed) / 3
This single value quantifies overall market sentiment and drives the strategy’s trading decisions.
Key Features
Sentiment-Based Trading Signals . Long Entry: Triggered when the CEI crosses above a lower threshold (e.g., 0.1), indicating increasing bullish sentiment. Short Entry: Triggered when the CEI crosses above a higher threshold (e.g., 0.2), signaling rising bearish sentiment.
Volume Confirmation . Trades are validated only if volume exceeds a user-defined multiplier of the average volume over the lookback period. This ensures entries are backed by significant market activity.
Break-Even Recovery Mechanism . If a trade moves into a loss, the strategy attempts to recover to break-even instead of immediately exiting at a loss. This feature provides flexibility, allowing the market to recover while maintaining disciplined risk management.
Dynamic Risk Management . Maximum Holding Period: Trades are closed after a user-defined number of candles to avoid overexposure to prolonged uncertainty. Profit-Taking Conditions: Positions are exited when favorable price moves are confirmed by increased volume, locking in gains. Loss Threshold: Trades are exited early if the price moves unfavorably beyond a set percentage of the entry price, limiting potential losses.
Cooldown Period . After a trade is closed, a cooldown period prevents immediate re-entry, reducing overtrading and improving signal quality.
Why Use This Strategy?
The CEI Strategy combines advanced sentiment analysis with robust trade management, making it a powerful tool for traders seeking to understand market psychology and identify high-probability setups. Its unique features, such as the break-even recovery mechanism and volume confirmation, add an extra layer of discipline and reliability to trading decisions.
Best Practices
Combine with Other Indicators . Use trend-following tools (e.g., moving averages, ADX) and momentum oscillators (e.g., RSI, MACD) to confirm signals.
Align with Key Levels . Incorporate support and resistance levels for refined entries and exits.
Multi-Market Compatibility . Apply this strategy to forex, crypto, stocks, or any asset class with strong volume and price action.
Indecision
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.
Indecision OscillatorThis Pine Script v6 component calculates and plots an "Indecision Oscillator" based on the presence of Doji and Spinning Top candlestick patterns over a user-defined lookback period.
Here's how it works:
User Inputs: length - the lookback period for calculating the oscillator, dojiThreshold - the threshold for identifying Doji patterns, spinningTopThreshold - the threshold for identifying Spinning Top patterns.
Pattern Detection: The script defines functions to detect Doji and Spinning Top patterns based on the body size relative to the total range of the candle.
Score Calculation: It calculates scores for Doji and Spinning Top patterns over the specified lookback period and normalizes these scores.
Indecision Oscillator: The oscillator is calculated as the average of the normalized Doji and Spinning Top scores.
Plotting: Only the Indecision Oscillator is plotted on the chart, with reference lines for neutral and indecision levels.
This component provides a visual representation of market indecision, which can be useful for traders looking to identify potential reversal points or periods of consolidation.
Volatility patterns / quantifytools- Overview
Volatility patterns detect various forms of indecisive price action, on a larger scale as a compressed range and on a smaller scale as indecision candles. Indecisive and volatility suppressing price action can be thought of as a spring being pressed down. The more suppression, the more tension is built and eventually released as a spike or series of spikes in volatility. Each volatility pattern is assigned an influence period, during which average and peak relative volatility is recorded and stored to volatility metrics.
- Patterns
The following scenarios are qualified as indecision candles: inside candles, indecision engulfing candles and volatility shifts.
By default, each indecision candle is considered a valid pattern only when another indecision candle has taken place within 3 periods, e.g. prior inside candle + indecision engulfing candle = valid volatility pattern. This measurement is taken to filter noise by looking for multiple hints of pending volatility, rather than just one. Level of tolerated noise can be changed via input menu by using sensitivity setting, by default set to 2.
Sensitivity at 1: Any single indecision candle is considered a valid pattern
Sensitivity at 2: 2 indecision candles within 3 bars is considered a valid pattern
Sensitivity at 3: 2 indecision candles within 2 bars (consecutive) is considered a valid pattern
The following scenarios are qualified as range patterns: series of lower highs/higher lows and series of low volatility pivots.
A pivot is defined by highest/lowest point in price, by default within 2 periods back and 2 periods forward. When 4 pivots with qualities mentioned above are found, a box indicating compressed range will appear. Both required pivots and pivot definition can be adjusted via input menu.
- Influence time and metrics
By default, influence time for each volatility pattern is set to 6 candles, a period for which spike(s) in volatility is expected. For each influence period, average relative volatility (volatility relative to volatility SMA 20) and peak relative volatility is recorded and stored to volatility metrics. All metrics used in calculations are visible in "Data Window "tab. Average and peak volatility during influence period will vary depending on chart, timeframe and chosen settings. Tweaking the settings might result in an improvement and is worth experimenting with.
- Visuals
By default, indecision candles are visualized as yellow lines and range patterns as orange boxes. Influence time periods are respectively visualized as colored candle borders, applied as long as influence time period is active. All colors are fully customizable via input menu.
- Practical guide
Volatility patterns depict moments of equal strength from both bulls and bears. While this equilibrium is in place, price is stagnant and compresses until either side initiates volatility, releasing the built up tension. On top of hedging and playing the volatility using volatility based instruments, some other methods can be applied to take advantage of the somewhat tricky areas of indecision.
Example #1: Trading volatility
Volatility is not a bad thing from a trading perspective, but can actually be fertile ground for executing trade setups. Trading volatility influence periods from higher timeframes on lower timeframes gives greater resolution to work with and opportunities to take advantage of the wild swings created.
Example #2: Finding bias for patterns
Points of confluence where it anyway makes sense to favor one side over the other can be used for establishing bias for indecisive price action as well. At face value, it makes sense to expect bearish reactions at range highs and bullish reactions at range low, for which volatility patterns can provide a catalyst.
Example #3: Betting on initiation direction
Betting on direction of the first volatile move can easily go against you, but if risk/reward is able to compensate for the poor win rate, it's a valid idea to consider and explore.
Indecision Indicator [CHE]"In times of great uncertainty, indecision is often the wisest course of action."
Introduction:
The Indecision Indicator is a custom script for use in Trading View. The script is designed to help traders determine potential reversal points in financial markets, by displaying different levels of indecision or rejection.
Glossary:
Indecision: Indicates a situation where the market is uncertain and can move in either direction.
Rejection: Indicates a situation where the market has rejected a certain price level and is likely to move in the opposite direction.
Totalwick: The total length of the upper and lower shadows on a candlestick chart.
MACD: Moving Average Convergence Divergence, a popular momentum indicator.
Inputs:
Rejection: Allows the user to choose between the different types of indecision to display, including Indecision, Rejection, Totalwick, All, and MACD.
Indecision Length: The number of candles used to calculate the indecision level.
Length: The length of the Moving Average used to smooth the indecision or rejection levels.
Trigger Length: The number of candles used to calculate the trigger line, which is used to indicate potential reversal points.
Output:
The script calculates the lower and upper rejection levels, as well as the indecision level, and displays them as lines on the chart. The lines are color-coded to indicate whether the market is in a state of indecision or rejection, and whether it is likely to move up or down.
Best regards
Chervolino
Indecision indicatorIndecision is calculated based on ratio of wicks-body to full candle.
Similarly price rejection is calculated based on ratio of upper wicks to candle and lower wicks to candle.
In both cases sum of stats from last N candels are used to get smoother output. Coloring of indecision candle is based on two bollinger bands with different standard deviations. It can be set in input settings.
NR7 IndicatorNR7 is a narrow range over the past 7 candles, range contraction leads to range expansion! Think of it like a potential turning point in stock movement, like a pivot point. The common school of thought is to treat a "7" like an indecision candle, using a bracket order or long/short if you only want to take it a single direction. You can find a free tool that lists a stocks making an NR7 here:
swingtradebot.com
Spinning TopsThis is my script for a spinning top. It is just another form of a doji. It is an indecision bar. Enjoy.