Discussing the article: "Creating Custom Indicators in MQL5 (Part 6): Evolving RSI Calculations with Smoothing, Hue Shifts, and Multi-Timeframe Support"

 

Check out the new article: Creating Custom Indicators in MQL5 (Part 6): Evolving RSI Calculations with Smoothing, Hue Shifts, and Multi-Timeframe Support.

In this article, we build a versatile RSI indicator in MQL5 supporting multiple variants, data sources, and smoothing methods for improved analysis. We add hue shifts for color visuals, dynamic boundaries for overbought/oversold zones, and notifications for trend alerts. It includes multi-timeframe support with interpolation, offering us a customizable RSI tool for diverse strategies.

The normal Relative Strength Index (RSI) measures the speed and change of price movements to identify overbought or oversold conditions, typically oscillating between 0 and 100 with boundaries at 70 and 30. We will advance the RSI by adding variations, such as Cuttler's, Ehlers', Harris', quick, basic, RSX, and gradual styles, to adjust its calculations and emphasize different aspects, including smoothing and responsiveness to market momentum. Data smoothing will apply averaging techniques—basic, growth-based, evened-out, or weighted linear—to preprocess price inputs, such as close, open, high, low, or derived averages, thereby reducing noise and providing clearer signals.

Hue shifts will change the indicator's color based on conditions like direction changes, center crossings, or boundary crossings, providing visual cues for trend reversals or strength. Dynamic boundaries will adapt overbought and oversold levels based on recent RSI extremes over a specified length, while static ones will use fixed percentages, and multi-timeframe support will allow analysis across different periods with optional interpolation for smoother visuals.

Our plan is to configure user inputs for selecting RSI variants, data sources, smoothing approaches, hue conditions, and boundary settings, then compute the RSI curve with these options, draw boundaries and fillings, handle multi-timeframe data, and trigger notifications on hue changes. In brief, this creates a customizable RSI tool that adapts to various market conditions and user preferences for technical analysis, producing an advanced RSI indicator compared to the traditional indicator, as illustrated below.

CONCEPTUAL FRAMEWORK

We can see that at the end, we’ll get an adaptive RSI engine that can calculate momentum from any price representation, not just the close. It will dynamically smooth both the input data and the RSI itself, letting us switch between fast, slow, or cycle-aware behavior without changing the core logic. On top of that, it will self-adjust its boundaries and visual states, so overbought/oversold signals adapt to market conditions instead of staying fixed. Let's get to implementing this!

Author: Allan Munene Mutiiria