Join today
Strategies / Mean reversion / Two-Period RSI

Two-Period RSI: Extreme Readings in the Trend Direction

Above the 200 SMA, an RSI(2) reading under 5 triggers a long; below it, a reading over 95 triggers a short. Longs close on a close above the 5 SMA and shorts on a close below it. There is no stop loss.

Mean reversionLong & shortIntradayUSD/JPY30 min
n/aProfit factor
194,020Net profit JPY
64.80%Win rate
4,574Trades
-71,680Max drawdown
42.42Avg trade

Best run of 13. USD/JPY, 30 min, spread 1, from run sweeps:2026-09-22-USDJPY-30m-opt.tsv:4.

Entry rules, long

  1. Price is above the 200-period SMA
  2. Members only

Entry rules, short

  1. Price is below the 200-period SMA
  2. Members only

Exit rules

  1. Members only
  2. Close a short when price closes below the 5-period SMA
  3. No stop loss

Test conditions

PeriodUp to 2026-09-22
InstrumentUSD/JPY, 30 minutes
Spread1 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-22

Parameters

positionSize
Contracts per trade
1
trendPeriod
Trend SMA length
200
exitPeriod
Exit SMA length
5
rsiPeriod
RSI length
2
oversoldLevel
Buy below this RSI level
5
overboughtLevel
Sell short above this RSI level
95

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run30 minn/a 4,57464.80194,020 JPY-71,680
USD/JPY1 hourn/a 3,24463.04268,370 JPY-99,400
EUR/USD4 hoursn/a 1,10364.8241,210 USD-12,790
Nikkei 225Dailyn/a 24664.6315,305 USD-9,920
Dow JonesDailyn/a 35764.1512,735 EUR-3,577
EUR/USD30 minn/a 4,38563.5110,629 USD-7,378
DAX 40Dailyn/a 36564.116,907 EUR-1,937
GBP/USDDailyn/a 33367.575,844 USD-3,495
Nasdaq 100Dailyn/a 24861.695,094 EUR-2,456
US Crude OilDailyn/a 26162.844,788 EUR-2,833
Brent Crude4 hoursn/a 41865.313,135 EUR-1,486
FTSE 100Dailyn/a 25164.141,934 EUR-1,199
S&P 500Dailyn/a 37862.961,863 EUR-547

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-100K-50K250K500KUSD/JPY · 1 hourUSD/JPY · 30 minEUR/USD · 4 hoursNikkei 225 · DailyDow Jones · DailyEUR/USD · 30 minDAX 40 · DailyGBP/USD · DailyNasdaq 100 · DailyUS Crude Oil · DailyBrent Crude · 4 hoursFTSE 100 · DailyS&P 500 · Daily

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.

// ============================================================
// Two-Period RSI
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 30 minutes
// ============================================================

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

// --- Parameters ---
positionSize = 1       // contracts per trade
trendPeriod = 200      // long-term trend filter
exitPeriod = 5         // short SMA used for the exit
rsiPeriod = 2          // RSI length
oversoldLevel = 5      // buy below this in an uptrend
overboughtLevel = 95   // sell short above this in a downtrend

// --- Indicators ---
trendMA = Average[trendPeriod](close)
exitMA = Average[exitPeriod](close)
rsiValue = RSI[rsiPeriod](close)

26 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • No stop loss, so a trade against a strong move stays open until price closes back through the 5 SMA.
  • The best run's max drawdown was JPY 71,680.0 against JPY 194,020.0 profit.
  • Profit factor was not recorded because only sweep data exists.
  • Index results are small next to forex, for example EUR 1,863.15 on S&P 500 Daily.

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

Can Two-Period RSI run in ProOrder?

Yes, it uses simple averages and RSI with market orders. The rewritten code is not compile-checked yet.

How did it do across markets?

USD/JPY 1 hour made JPY 268,370.0 and EUR/USD 4 hours USD 41,210.0. Dow Jones Daily made EUR 12,734.8 and FTSE 100 Daily EUR 1,934.4.

What capital does 1 contract need?

The best run had a JPY 71,680.0 drawdown with 1 contract on USD/JPY. On Dow Jones Daily it was EUR 3,577.4.

Why 30 minute bars on USD/JPY?

RSI(2) reaches extremes often on 30 minutes, giving 4,574 trades, enough to read the result.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Supertrend Counter Trend

Best run on the same market, USD/JPY.

3.47 PF · 1,444 trades

Monday Dip Buy

Also a mean reversion strategy.

n/a PF · 146 trades

Join the conversation on short term RSI systems. Get on the ProRealAlgos community 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