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.
Best run of 13. USD/JPY, 30 min, spread 1, from run sweeps:2026-09-22-USDJPY-30m-opt.tsv:4.
| Period | Up to 2026-09-22 |
| Instrument | USD/JPY, 30 minutes |
| Spread | 1 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-22 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 30 min | n/a | 4,574 | 64.80 | 194,020 JPY | -71,680 |
| USD/JPY | 1 hour | n/a | 3,244 | 63.04 | 268,370 JPY | -99,400 |
| EUR/USD | 4 hours | n/a | 1,103 | 64.82 | 41,210 USD | -12,790 |
| Nikkei 225 | Daily | n/a | 246 | 64.63 | 15,305 USD | -9,920 |
| Dow Jones | Daily | n/a | 357 | 64.15 | 12,735 EUR | -3,577 |
| EUR/USD | 30 min | n/a | 4,385 | 63.51 | 10,629 USD | -7,378 |
| DAX 40 | Daily | n/a | 365 | 64.11 | 6,907 EUR | -1,937 |
| GBP/USD | Daily | n/a | 333 | 67.57 | 5,844 USD | -3,495 |
| Nasdaq 100 | Daily | n/a | 248 | 61.69 | 5,094 EUR | -2,456 |
| US Crude Oil | Daily | n/a | 261 | 62.84 | 4,788 EUR | -2,833 |
| Brent Crude | 4 hours | n/a | 418 | 65.31 | 3,135 EUR | -1,486 |
| FTSE 100 | Daily | n/a | 251 | 64.14 | 1,934 EUR | -1,199 |
| S&P 500 | Daily | n/a | 378 | 62.96 | 1,863 EUR | -547 |
Charts
The code
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
Questions
Yes, it uses simple averages and RSI with market orders. The rewritten code is not compile-checked yet.
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.
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.
RSI(2) reaches extremes often on 30 minutes, giving 4,574 trades, enough to read the result.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.