The Reverse RSI Bands is an advanced MQL5 custom indicator that answers a critical question for technical traders: "At what exact price will the RSI hit overbought (70) or oversold (30) levels?" Instead of plotting the traditional RSI oscillator in a separate sub-window, this indicator mathematically reverse-engineers the RSI formula and plots the exact target price levels directly on your main chart as dynamic bands. This provides unparalleled predictive power, allowing you to anticipate market extremes before they happen.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alex David Hernandez Maturrano 922b5bdf7b Updated improvements.md
2026-08-12 23:24:28 -03:00
.gitignore Initial commit: Reverse RSI Bands 2026-08-12 22:26:11 -03:00
improvements.md Updated improvements.md 2026-08-12 23:24:28 -03:00
README.md Updated readme 2026-08-12 23:21:52 -03:00
Reverse_RSI_Bands.ex5 Initial commit: Reverse RSI Bands 2026-08-12 22:26:11 -03:00
Reverse_RSI_Bands.mq5 Optimize performance by removing RSI verification buffer 2026-08-12 22:42:37 -03:00
Reverse_RSI_Bands.png Updated readme 2026-08-12 23:21:52 -03:00

Reverse RSI Bands

Overview

Reverse RSI Bands is an advanced MQL5 custom indicator designed for the MetaTrader 5 platform. It mathematically reverse-engineers the Relative Strength Index (RSI) formula to plot exact price levels on your main chart. These bands show you precisely at what price the RSI will hit your specified overbought or oversold levels.

Unlike the traditional RSI, which is a lagging oscillator shown in a sub-window, the Reverse RSI Bands indicator is a leading tool. By displaying the exact price thresholds directly on the chart, traders can anticipate market extremes, set precise limit orders, and identify dynamic support/resistance zones before the oscillator reaches its target.

Key Features

  • Predictive Price Bands: Plots Overbought (crimson) and Oversold (green) target price bands directly on the chart.
  • Exact Mathematical Precision: Uses precise algebraic deductions of the recursive Wilder Smoothing formula to guarantee the price levels match the standard RSI exactly.
  • True Temporal Lookahead: Calculates the required price for the current bar using the verified state of the previous bar, ensuring accurate real-time targeting without self-contamination.
  • Zero Initialization Offset: Implements a true Simple Moving Average (SMA) seed for the first N-bars (matching the native MetaTrader RSI), avoiding the persistent calculation drift seen in EMA-based approximations.

Input Parameters

  • RSI Period (InpPeriodRSI): The lookback period for the RSI calculation (Default: 14).
  • Overbought target RSI (InpObLevel): The RSI level that defines the upper price band (Default: 70.0).
  • Oversold target RSI (InpOsLevel): The RSI level that defines the lower price band (Default: 30.0).
  • Applied Price (InpAppliedPrice): The price type used for calculations (Default: Close Price).

Installation

  1. Copy the Reverse_RSI_Bands.mq5 file to your MetaTrader 5 Indicators folder (usually MQL5\Indicators).
  2. Compile the indicator in the MetaEditor.
  3. Attach the indicator to any chart.

How to Use

  • Reversal Trading: Look for price action to touch or pierce the Overbought or Oversold bands, indicating a potential reversal as the RSI hits extreme levels.
  • Limit Orders: Place Buy Limit orders near the Oversold band and Sell Limit orders near the Overbought band.
  • Dynamic Support/Resistance: The bands act as dynamic, mathematically-driven support and resistance levels based on momentum.

Technical Notes (For Developers)

Please read the improvements.md file for a detailed mathematical breakdown of how the Reverse RSI formula was derived and how it improves upon naive implementations.

This project was inspired by the original paper "The Revenge Of The Indicators Reverse Engineering RSI" published in Stocks & Commodities magazine in June, 2003 by Giorgos Siligardos. The initial MQL5 implementation idea was inspired by the Reverse_Engineering_RSI indicator by 'Scriptor' published in the MQL5 Code Base on 2018.07.09. This repository provides a mathematically corrected and architecturally enhanced version.