Join today
Strategies / Mean reversion / RSI(2) Trend Filter

RSI(2) Trend Filter Strategy

Two trend checks come first: RSI(22) must sit above 50 and the 22-period SMA must be rising. When RSI(2) then drops below 15, the system buys the dip. It sells as soon as RSI(2) climbs back above 60.

Mean reversionLong onlySwingGoldDaily
1.73Profit factor
910Net profit EUR
54.72%Win rate
254Trades
-300Max drawdown
3.58Avg trade

Best run of 12. Gold, Daily, spread 0.6, from run pf:2026-09-24-GOLD-D.tsv:3.

Entry rules, long

  1. No long position is open
  2. Members only
  3. RSI(22) above 50
  4. The 22-period SMA is rising

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-25
InstrumentGold, Daily
Spread0.6 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-25

Parameters

positionSize
Contracts per trade
1
rsiPeriod
Short RSI length
2
oversoldLevel
Buy below this short RSI
15
trendPeriod
SMA whose slope must be positive
22
rsiTrendPeriod
Longer RSI used as a trend filter
22
rsiTrendLevel
Longer RSI must be above this
50
rsiExitLevel
Sell when the short RSI rises above this
60

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest runDaily1.73 25454.72910 EUR-300
USD/JPY1 hourn/a 2,68767.55181,010 JPY-99,390
USD/JPY30 minn/a 3,76365.80163,430 JPY-99,320
EUR/USDDailyn/a 24671.1443,073 USD-18,040
Nikkei 225Dailyn/a 28070.7116,267 USD-7,220
EUR/USD4 hoursn/a 90865.2015,037 USD-13,145
US Crude OilDailyn/a 24370.378,694 EUR-2,370
Nasdaq 100Dailyn/a 30966.027,279 EUR-2,661
Dow Jones1 hourn/a 83669.384,781 EUR-3,935
S&P 500Dailyn/a 40362.031,831 EUR-502
FTSE 100Dailyn/a 27968.101,506 EUR-1,165
Gold4 hoursn/a 66167.02603 EUR-408

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-100K-50K100K200KUSD/JPY · 1 hourUSD/JPY · 30 minEUR/USD · DailyNikkei 225 · DailyEUR/USD · 4 hoursUS Crude Oil · DailyNasdaq 100 · DailyDow Jones · 1 hourS&P 500 · DailyFTSE 100 · DailyGold · DailyGold · 4 hours

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// RSI(2) Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1          // contracts per trade
rsiPeriod = 2             // short RSI length
oversoldLevel = 15        // buy below this short RSI
trendPeriod = 22          // SMA whose slope must be positive
rsiTrendPeriod = 22       // longer RSI used as a trend filter
rsiTrendLevel = 50        // longer RSI must be above this
rsiExitLevel = 60         // sell when the short RSI rises above this

// --- Indicators ---
rsiValue = RSI[rsiPeriod](close)
rsiTrend = RSI[rsiTrendPeriod](close)
trendMA = Average[trendPeriod](close)
trendSlope = trendMA / trendMA[1] - 1

14 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • No stop loss is used, so a dip that becomes a sharp decline is held until RSI(2) recovers.
  • The headline Gold daily run made only EUR 909.90 at 1 contract, with an average trade of EUR 3.58, so costs take a real bite.
  • Some markets had deep drawdowns next to profit, such as USD/JPY 1 hour with JPY 99,390.00 drawdown on JPY 181,010.00 profit.
  • Profit factor is only recorded for the Gold daily run. The other markets come from sweep data without it.

Indicators used

RSISMA

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Will it run unattended in ProOrder?

Yes. The rules are fully coded and it trades 1 contract per signal, long only.

What did the tests show?

Gold daily had profit factor 1.73 over 254 trades. All eleven market and timeframe runs were profitable, from USD/JPY 1 hour (JPY 181,010.00) down to Gold 4 hours (EUR 602.70).

What drawdown comes with 1 contract?

On Gold daily the max drawdown was EUR 299.80. Forex runs are sized very differently, so check the market you plan to trade.

Why daily bars for Gold?

Daily RSI(2) dips inside a rising market tend to snap back within days. On Gold 4 hours the system traded 661 times but made less money.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Triple Band Market Model

Best run on the same market, Gold.

2.27 PF · 203 trades

SuperTrend CCI

A similar profit factor.

1.72 PF · 561 trades

Short-term dip systems shine when combined. Join the ProRealAlgos waitlist.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs