OPEN-SOURCE SCRIPT
Pendiente EMA20

This indicator measures the slope of the 20-period Exponential Moving Average (EMA20) to objectively determine whether it is rising, falling, or flat, removing the need for visual guesswork.
The slope is calculated as the difference between the current EMA20 value and its value N bars ago.
This provides a simple and reliable way to filter market conditions:
Positive slope → EMA20 is rising (bullish bias)
Negative slope → EMA20 is falling (bearish bias)
Near zero → EMA20 is flat (range / no clear trend)
The background color highlights these states for quick visual confirmation.
Notes
A zero threshold is included by default and may need adjustment depending on the asset and timeframe.
For better robustness in ranging markets, consider normalizing the slope using ATR or ticks.
This indicator is intended as a trend filter, not as a standalone trading system.
The slope is calculated as the difference between the current EMA20 value and its value N bars ago.
This provides a simple and reliable way to filter market conditions:
Positive slope → EMA20 is rising (bullish bias)
Negative slope → EMA20 is falling (bearish bias)
Near zero → EMA20 is flat (range / no clear trend)
The background color highlights these states for quick visual confirmation.
Notes
A zero threshold is included by default and may need adjustment depending on the asset and timeframe.
For better robustness in ranging markets, consider normalizing the slope using ATR or ticks.
This indicator is intended as a trend filter, not as a standalone trading system.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.