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.
Signalgenerator
[pp] Signal GeneratorResearch and Development Tool.
For anyone who is familiar with working with digital signals (audio/electrical engineers) you might appreciate this Signal Generator.
You can select and vary 4 different types of signals.
Logistic Map
If you're not familiar with the logistic map, then go watch a youtube video. By default the equation is meant to represent chaos and is a good alternative for random number generation.
Random
This uses the built-in random number generator. I'm not sure if it's better to use this or the logmap default settings. Either way, you have a choice.
Unit Impulse
Good for creating a transient impulse.
Step Impulse
Similar to the unit impulse. Except constant and not a transient.
Synthesizer
It comes with 4 wave functions (Sine, Triangle, Square, Saw) that can be combined for additive synthesis. Each wave function contains its own respective phase and amplitude control.
Credits
Many of these functions were taken from www.pinecoders.com with the exception of the logistic map. I simply aggregated them all into this toolkit for ease of use.
How to use
This is not a trading indicator. This is meant to be used for research and development. You could use it to test strategies, by generating white noise with the logmap and creating trading signals. Or you could use it for teaching and learning. Using the constant data as a dependable, repeatable resource.