TrendAlpha

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.
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?