Always between 0 and 100, so it can be compared across currency pairs and timeframes.
What is the RSI indicator?
Measures the strength of recent price moves and maps it to an easy-to-compare 0–100 scale.
What is Relative Strength Index?
A 0–100 oscillator that measures the speed and size of price changes, often used to spot overbought/oversold zones.
Illustrative signals of the rule on simulated data — not a trading recommendation.
Rule: RSI(14) crosses above 30: buy; crosses below 70: sell. Entry = close of the signal candle; SL = entry ∓ 1.5 × ATR(14); TP1/TP2/TP3 = 1R/2R/3R.
Where this indicator is strong
Three reasons Relative Strength Index is still used after decades.
Price makes a higher high while RSI does not — a sign that momentum is running out.
It reacts before price reverses, so use it to prepare, not to enter blindly.
How to read Relative Strength Index signals
How Relative Strength Index (RSI) produces its number, and what each shape on the chart means.
Formula and how it works
RSI compares the average gain and the average loss over N periods using Wilder smoothing. The formula is RSI = 100 − 100/(1 + AvgGain/AvgLoss). Values above 70 suggest overbought, below 30 suggest oversold.
Look for divergence between RSI and price to warn of a reversal; or look to buy when RSI leaves the oversold zone (30) and sell when it leaves the overbought zone (70).
The market oscillates around a price zone, where overextended moves tend to get pulled back.
A strong one-way trend. RSI stays above 70 for many sessions while price keeps rising, and every counter-trend sell loses.
Treating 70 and 30 as buy and sell orders. They are thresholds describing a state, not entry signals.
Recommended MT5 parameters for Relative Strength Index
Default values of the sample file; test them for your market and timeframe.
| Parameter | Description |
|---|---|
| InpPeriod | Period for the average gain/loss (default 14). |
Put the indicator into MetaTrader 5
Four steps, no software needed besides MT5.
Click the download button above; the file saves to your computer under the indicator's name.
In MetaTrader 5 choose File → Open Data Folder, then go to MQL5/Indicators.
Open the file in MetaEditor and click Compile. No errors means the indicator is ready.
Go back to MT5, refresh the Navigator and drag the indicator onto the price chart.
DinexSpace wrote this file from the indicator's public formula, not from any commercial source. You are free to edit and reuse it.
How it differs from MetaTrader 5's built-in indicator
The short answer: the formula is not different. What differs is what you can do with it.
Relative Strength Index here gives exactly the same number as MetaTrader 5's built-in version — on purpose. The four points below are what differs, and all four can be read from the very rsi.mq5 you download.
- Calls a built-in indicator
- No — the calculation sits in
OnCalculateand can be copied straight into an EA - External libraries
- Not a single #import declaration
- Code length
- 60 lines · 1
inputparameters - How it draws
- A separate window below the price chart · calculated incrementally, does not redraw the past
Why this library promises no secret formula — read the full explanation on the library page.
Which indicators to pair Relative Strength Index with, and what you gain
Each indicator only answers one question. Pairing well means covering the right weakness, not stacking more.
- What you gain
- Filters the allowed direction. In an uptrend by the MA, only take RSI signals leaving the oversold zone and drop all overbought signals.
- Note
- This handles RSI's fatal weakness: it reads overbought for many sessions while price keeps rising.
- What you gain
- Double confirmation at the band edge. When price touches the lower band and RSI is also below 30, two separate measures both say price has strayed far.
- Note
- Both indicators measure deviation from an average, so they are not truly independent — do not treat them as two separate pieces of evidence.
- What you gain
- Know when RSI can be trusted. ADX below 20 means a sideways market, exactly when RSI works best; with a high ADX, set reversal signals aside.
- Note
- This pair changes the question from 'what does RSI say' to 'should I listen to RSI right now'.
Frequently asked questions about Relative Strength Index
Is RSI above 70 a sell signal?
No. It describes a state: price has risen strongly relative to its own recent history. In a healthy uptrend, RSI can stay above 70 for dozens of sessions while price keeps rising. The signal usually used is when RSI LEAVES the extreme zone, not when it touches it.
Is RSI divergence reliable?
Divergence is a warning that momentum is running out, not a reversal order. It can appear many times before price actually turns. Use it to tighten risk or take partial profit, and wait for price to confirm before entering the other way.
Does Relative Strength Index on this page use real or simulated data?
The chart on this page uses a deterministic simulated candle series; it is not market prices or trading results.
Using Relative Strength Index in an EA, and further reading
State the candle-close condition, parameters and server time clearly when you put the rule into an EA. See the EAs available on the marketplace to compare options, or read how to read MT5 backtest results before judging any EA.
Other momentum indicators
Indicators in the same momentum group, often used instead of or alongside Relative Strength Index.
An indicator draws signals, but when to enter, where to stop out and how much to risk are still your set of rules. Send those rules and DinexSpace builds them into an EA.