33 lines
3.2 KiB
Markdown
33 lines
3.2 KiB
Markdown
# 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"](https://c.mql5.com/forextsd/forum/138/reverse_engineering_rsi.pdf) 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'](https://www.mql5.com/en/code/21046) published in the MQL5 Code Base on 2018.07.09. This repository provides a mathematically corrected and architecturally enhanced version.
|