OPEN-SOURCE SCRIPT
Dual EMA Spread

Introduction
Dual EMA Spread is a trend analysis indicator that measures the percentage difference between a fast Exponential Moving Average (EMA) and a slow Exponential Moving Average.
While moving average crossovers are commonly used to identify potential trend changes, they do not reveal how far apart the two averages are. Dual EMA Spread addresses this by quantifying the separation between the fast and slow EMAs, helping traders evaluate whether trend momentum is strengthening, weakening, or transitioning.
The indicator is displayed as a histogram centered around a zero line, providing a simple visual representation of the relationship between the two moving averages.
How It Works
The indicator calculates two Exponential Moving Averages using user-defined periods.
It then measures the percentage difference between the fast EMA and the slow EMA using the following formula:
Dual EMA Spread = ((Fast EMA − Slow EMA) / Slow EMA) × Scale Factor
Positive values indicate that the fast EMA is trading above the slow EMA.
Negative values indicate that the fast EMA is trading below the slow EMA.
As the spread widens, the indicator suggests that the distance between the two averages is increasing, reflecting stronger directional momentum.
Key Features
Percentage-Based Spread
The difference between the two EMAs is expressed as a percentage rather than an absolute price value, making the indicator more consistent across instruments with different price ranges.
Trend Bias at a Glance
The zero line clearly shows whether the fast EMA is positioned above or below the slow EMA, providing an immediate view of the prevailing market bias.
Trend Strength Visualization
Changes in the histogram help visualize whether the separation between the two moving averages is expanding or contracting.
Lightweight and Efficient
The indicator performs a straightforward calculation, making it suitable for all markets and timeframes without adding unnecessary complexity.
Interpretation
Above Zero
Positive values indicate that the fast EMA is above the slow EMA, suggesting bullish market conditions.
An expanding positive histogram often reflects increasing bullish momentum.
Below Zero
Negative values indicate that the fast EMA is below the slow EMA, suggesting bearish market conditions.
An expanding negative histogram indicates strengthening bearish momentum.
Near Zero
Values close to zero indicate that the two EMAs are converging.
This frequently occurs during consolidation, trend transitions, or periods of reduced momentum.
Expanding Spread
When the histogram moves further away from zero, the distance between the fast and slow EMAs is increasing.
This generally reflects strengthening trend momentum.
Contracting Spread
When the histogram moves back toward zero, the two EMAs are converging.
This often indicates slowing momentum or the early stages of market consolidation.
Alert Conditions
The indicator includes two built-in alert conditions:
Bullish EMA Spread
- Triggered when the fast EMA crosses above the slow EMA, causing the spread to cross above zero.
Bearish EMA Spread
- Triggered when the fast EMA crosses below the slow EMA, causing the spread to cross below zero.
These alerts help traders monitor potential changes in market direction without continuously watching the chart.
Example Applications
- Identifying bullish and bearish market bias.
- Confirming moving average crossovers.
- Measuring trend strength through EMA separation.
- Monitoring momentum expansion and contraction.
- Comparing trend conditions across multiple instruments and timeframes.
Notes
Dual EMA Spread is designed as a trend analysis tool rather than a standalone trading system.
Although an expanding spread often reflects strengthening momentum, it should not be interpreted as a guarantee that the trend will continue. Likewise, a contracting spread does not necessarily indicate an immediate reversal.
For best results, use Dual EMA Spread together with price action, market structure, and support and resistance analysis to build a more complete understanding of market conditions.
Dual EMA Spread provides a simple and intuitive way to measure the relationship between fast and slow moving averages, helping traders visualize trend strength, momentum expansion, and potential market transitions.
Dual EMA Spread is a trend analysis indicator that measures the percentage difference between a fast Exponential Moving Average (EMA) and a slow Exponential Moving Average.
While moving average crossovers are commonly used to identify potential trend changes, they do not reveal how far apart the two averages are. Dual EMA Spread addresses this by quantifying the separation between the fast and slow EMAs, helping traders evaluate whether trend momentum is strengthening, weakening, or transitioning.
The indicator is displayed as a histogram centered around a zero line, providing a simple visual representation of the relationship between the two moving averages.
How It Works
The indicator calculates two Exponential Moving Averages using user-defined periods.
It then measures the percentage difference between the fast EMA and the slow EMA using the following formula:
Dual EMA Spread = ((Fast EMA − Slow EMA) / Slow EMA) × Scale Factor
Positive values indicate that the fast EMA is trading above the slow EMA.
Negative values indicate that the fast EMA is trading below the slow EMA.
As the spread widens, the indicator suggests that the distance between the two averages is increasing, reflecting stronger directional momentum.
Key Features
Percentage-Based Spread
The difference between the two EMAs is expressed as a percentage rather than an absolute price value, making the indicator more consistent across instruments with different price ranges.
Trend Bias at a Glance
The zero line clearly shows whether the fast EMA is positioned above or below the slow EMA, providing an immediate view of the prevailing market bias.
Trend Strength Visualization
Changes in the histogram help visualize whether the separation between the two moving averages is expanding or contracting.
Lightweight and Efficient
The indicator performs a straightforward calculation, making it suitable for all markets and timeframes without adding unnecessary complexity.
Interpretation
Above Zero
Positive values indicate that the fast EMA is above the slow EMA, suggesting bullish market conditions.
An expanding positive histogram often reflects increasing bullish momentum.
Below Zero
Negative values indicate that the fast EMA is below the slow EMA, suggesting bearish market conditions.
An expanding negative histogram indicates strengthening bearish momentum.
Near Zero
Values close to zero indicate that the two EMAs are converging.
This frequently occurs during consolidation, trend transitions, or periods of reduced momentum.
Expanding Spread
When the histogram moves further away from zero, the distance between the fast and slow EMAs is increasing.
This generally reflects strengthening trend momentum.
Contracting Spread
When the histogram moves back toward zero, the two EMAs are converging.
This often indicates slowing momentum or the early stages of market consolidation.
Alert Conditions
The indicator includes two built-in alert conditions:
Bullish EMA Spread
- Triggered when the fast EMA crosses above the slow EMA, causing the spread to cross above zero.
Bearish EMA Spread
- Triggered when the fast EMA crosses below the slow EMA, causing the spread to cross below zero.
These alerts help traders monitor potential changes in market direction without continuously watching the chart.
Example Applications
- Identifying bullish and bearish market bias.
- Confirming moving average crossovers.
- Measuring trend strength through EMA separation.
- Monitoring momentum expansion and contraction.
- Comparing trend conditions across multiple instruments and timeframes.
Notes
Dual EMA Spread is designed as a trend analysis tool rather than a standalone trading system.
Although an expanding spread often reflects strengthening momentum, it should not be interpreted as a guarantee that the trend will continue. Likewise, a contracting spread does not necessarily indicate an immediate reversal.
For best results, use Dual EMA Spread together with price action, market structure, and support and resistance analysis to build a more complete understanding of market conditions.
Dual EMA Spread provides a simple and intuitive way to measure the relationship between fast and slow moving averages, helping traders visualize trend strength, momentum expansion, and potential market transitions.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.