Convergence Divergence Impulse Counter V0
Aug 2, 2016

The Convergence Divergence Impulse Counter V0 indicator tracks and counts the number of short-term impulses that occur in alignment with a broader trend, helping traders identify the maturity of a market move. By analyzing the relationship between price and multiple moving averages, it provides a cumulative count of trend-following surges.
Usage
The indicator is displayed as a histogram that tracks "impulses" within a trend. A trend is defined by the relationship between a fast EMA and a slow EMA. When the fast EMA is above the slow EMA, the trend is considered bullish; when below, it is bearish.
- Initial Trend Shift: When the trend first establishes itself (the EMAs cross), the counter starts at 1 (bullish) or -1 (bearish).
- Impulse Counting: As price fluctuates, every time the price crosses back over its short-term EMA in the direction of the main trend, the counter increments. For example, in a bullish trend, each time the price moves from below the fast EMA to above it, the count increases (e.g., 2, 3, 4).
- Trend Reversal: The counter resets and changes sign only when the broader trend (the relationship between the two EMAs) reverses.
Traders can use this to gauge the strength of a trend. High counts may indicate a strong, persistent trend, but could also suggest an overextended market prone to exhaustion.
Details
The script utilizes two exponential moving averages (EMA) to define the "Convergence Divergence" environment.
- Trend Filter: The relationship between EMA 1 (Length 1) and EMA 2 (Length 2) determines the primary trend direction.
- Impulse Logic: The script monitors the "CD01" value, which is the distance between price and the fast EMA. An impulse is registered when the price crosses the fast EMA (CD01 crosses 0) while the broader trend remains intact.
- Visualization: The counter is plotted as a column chart, with green columns representing bullish impulses and red columns representing bearish impulses.
Settings
- Length 1: The period for the fast Exponential Moving Average (default is 20). This affects the frequency of impulse detection.
- Length 2: The period for the slow Exponential Moving Average (default is 100). This determines the sensitivity of the broader trend filter.
- Source: The price data used for calculations (default is Close).
FAQ
How do I interpret high impulse counts?
High counts indicate that the trend has successfully resumed its direction multiple times. While this shows trend strength, very high numbers might precede a period of consolidation or reversal.
What causes the counter to reset to zero or change direction?
The counter resets and flips its sign when the fast EMA crosses the slow EMA, signaling a change in the primary trend direction.
How can I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.