Discussing the article: "Creating Custom Indicators in MQL5 (Part 5): WaveTrend Crossover Evolution Using Canvas for Fog Gradients, Signal Bubbles, and Risk Management"

 

Check out the new article: Creating Custom Indicators in MQL5 (Part 5): WaveTrend Crossover Evolution Using Canvas for Fog Gradients, Signal Bubbles, and Risk Management.

In this article, we enhance the Smart WaveTrend Crossover indicator in MQL5 by integrating canvas-based drawing for fog gradient overlays, signal boxes that detect breakouts, and customizable buy/sell bubbles or triangles for visual alerts. We incorporate risk management features with dynamic take-profit and stop-loss levels calculated via candle multipliers or percentages, displayed through lines and a table, alongside options for trend filtering and box extensions.

The enhanced canvas-based WaveTrend crossover framework builds on the core momentum oscillator by incorporating visual overlays and risk tools to provide us with a more immersive and practical trading interface. It maintains dual WaveTrend configurations—a sensitive one for detecting crossovers that signal potential entries and a slower one for filtering trends—while adding breakout detection through signal boxes that form around crossover points and close on price breaches, indicating confirmed momentum shifts. Fog gradients overlay the chart to visually represent trend strength with fading transparency, helping us gauge market context at a glance, alongside customizable signals displayed as bubbles with labels or simple triangles for clear buy and sell alerts.

In a bullish setup, a crossover upward on the signal oscillator, optionally confirmed by an uptrend on the slower oscillator, initiates a box around the bar's range; upon an upward breakout from the box, a buy signal triggers if it aligns with the box direction, with visuals emphasizing the opportunity. Conversely, in a bearish setup, a downward crossover forms a box, and a downward breakout generates a sell signal under matching conditions, allowing us to act on reversals or continuations with reduced noise. Risk management is integrated by calculating take-profit and stop-loss levels based on average candle sizes or percentage moves, displayed dynamically to aid in position sizing and exit planning. This way, we are able to tell the hit rate.

We will leverage the MQL5 Canvas library for rendering fog gradients that interpolate between bars for smooth trend visualization, track signal boxes to detect and close on breakouts with optional extensions using average candle multipliers, offer flexible signal types like labeled bubbles for enhanced readability, and compute risk levels with user-defined modes for take-profit and stop-loss, all while ensuring efficient redraws on chart changes. In brief, here is a visual representation of our objectives.

MQL5 CANVAS-BASED EVOLUTION FRAMEWORK

Author: Allan Munene Mutiiria