Discussing the article: "Creating Custom Indicators in MQL5 (Part 4): Smart WaveTrend Crossover with Dual Oscillators"

 

Check out the new article: Creating Custom Indicators in MQL5 (Part 4): Smart WaveTrend Crossover with Dual Oscillators.

In this article, we develop a custom indicator in MQL5 called Smart WaveTrend Crossover, utilizing dual WaveTrend oscillators—one for generating crossover signals and another for trend filtering—with customizable parameters for channel, average, and moving average lengths. The indicator plots colored candles based on the trend direction, displays buy and sell arrow signals on crossovers, and includes options to enable trend confirmation and adjust visual elements like colors and offsets.

The Smart WaveTrend Crossover framework relies on the WaveTrend oscillator, a momentum-based tool that measures overbought and oversold conditions using smoothed price averages. This helps us identify potential reversals or continuations in market momentum. It computes a source price from highs, lows, and closes, then applies exponential moving averages to create two lines: a faster oscillating line and a slower smoothed line. Crossovers between these lines signal buying or selling opportunities. By using dual WaveTrend configurations—one with shorter periods for sensitive signal generation and another with longer periods for overall trend detection—we can combine quick entry cues with broader market context. This helps filter out false signals in choppy conditions.

In a bullish setup, we look for the faster line to cross above the slower line on the signal oscillator. This indicates building upward momentum, especially when it aligns with an uptrend from the slower oscillator. In a bearish setup, the faster line crossing below the slower line suggests downward momentum. Ideally, this is confirmed by a downtrend on the slower oscillator to avoid counter-trend trades. This approach enables us to capitalize on momentum shifts while respecting the prevailing trend. Additional visuals, such as colored candles, highlight trend direction, and arrows mark precise signal points.

We plan to calculate the WaveTrend values separately for signals and trends using customizable lengths for channels, averages, and moving averages, detect crossovers on the signal side, and apply an optional trend filter to ensure signals match the trend direction. We will incorporate visual elements such as candle coloring based on trend state and offset arrows for buy or sell indications, creating a comprehensive system that provides clear, actionable insights for momentum trading. In brief, here is a visual representation of our objectives.

INDICATOR FRAMEWORK

Author: Allan Munene Mutiiria