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.
Best run of 12. Gold, Daily, spread 0.6, from run pf:2026-09-24-GOLD-D.tsv:3.
| Period | Up to 2026-09-25 |
| Instrument | Gold, Daily |
| Spread | 0.6 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-25 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 1.73 | 254 | 54.72 | 910 EUR | -300 |
| USD/JPY | 1 hour | n/a | 2,687 | 67.55 | 181,010 JPY | -99,390 |
| USD/JPY | 30 min | n/a | 3,763 | 65.80 | 163,430 JPY | -99,320 |
| EUR/USD | Daily | n/a | 246 | 71.14 | 43,073 USD | -18,040 |
| Nikkei 225 | Daily | n/a | 280 | 70.71 | 16,267 USD | -7,220 |
| EUR/USD | 4 hours | n/a | 908 | 65.20 | 15,037 USD | -13,145 |
| US Crude Oil | Daily | n/a | 243 | 70.37 | 8,694 EUR | -2,370 |
| Nasdaq 100 | Daily | n/a | 309 | 66.02 | 7,279 EUR | -2,661 |
| Dow Jones | 1 hour | n/a | 836 | 69.38 | 4,781 EUR | -3,935 |
| S&P 500 | Daily | n/a | 403 | 62.03 | 1,831 EUR | -502 |
| FTSE 100 | Daily | n/a | 279 | 68.10 | 1,506 EUR | -1,165 |
| Gold | 4 hours | n/a | 661 | 67.02 | 603 EUR | -408 |
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.
// ============================================================ // 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
Questions
Yes. The rules are fully coded and it trades 1 contract per signal, long only.
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).
On Gold daily the max drawdown was EUR 299.80. Forex runs are sized very differently, so check the market you plan to trade.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.