Momentum Oscillator, Divergences & Signals [TrendAlpha]

The "Momentum, Real Time Divergences & Signals " indicator is designed to provide traders with insights into market momentum, identify potential divergences, and generate buy and sell signals. It offers a comprehensive set of features to assist traders in making informed trading decisions.

The indicator starts by calculating the momentum oscillator based on user-defined parameters.

- Traders can adjust the "Length" parameter to customize the sensitivity of the oscillator. The default value is set to 7, but it can be modified according to individual preferences.
- The "Source" parameter allows traders to select the input source for the oscillator calculation, with the default being the closing price of the asset.
- Traders have the option to display divergence lines by switching on the "Show Lines" parameter. This feature helps identify potential divergences between the oscillator and the price.

The oscillator is calculated using a two-step process. First, a smoothing function is applied to the source data using the "sma" (simple moving average) function. Then, the rate of change is computed over the specified length using the "mom" (momentum) function. Positive oscillator values indicate upward momentum, while negative values indicate downward momentum.

The indicator also generates buy and sell signals by identifying bullish and bearish divergences. A bullish divergence occurs when the oscillator is negative and crosses above zero, while a bearish divergence occurs when the oscillator is positive and crosses below zero. The indicator checks for specific conditions to confirm the divergences, such as comparing the current oscillator value with the previous value and validating the corresponding price action.

When a bullish or bearish divergence is detected, the indicator plots circles to highlight these signals on the chart. A green circle indicates a bullish signal, suggesting a potential buying opportunity, while a red circle indicates a bearish signal, suggesting a potential selling opportunity. In addition to circles, the indicator also displays labels to provide further clarity on the signals. A "Buy" label is shown for bullish signals, and a "Sell" label is shown for bearish signals.

To visually represent the divergences, the indicator plots lines connecting the corresponding points on the oscillator. A green line is drawn for bullish divergences, while a red line is drawn for bearish divergences. Traders can easily observe the divergence patterns and their relationships with the price action, aiding them in making trading decisions.

- The indicator also includes alert conditions for both bullish and bearish divergences. Traders can set up alerts to receive notifications when potential divergences occur, allowing them to take timely action.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?