In an uptrend above the 200 SMA, a close under the 5 SMA with RSI(2) below 13 triggers a long. Shorts use the reverse, with RSI(2) above 83 below the 200 SMA. Longs close on a cross above the 9 SMA and shorts on a cross below the 5 SMA.
Best run of 11. Nasdaq 100, Daily, spread 3, from run pf:2026-09-24-NAS100-D.tsv:1.
| Period | Up to 2026-09-24 |
| Instrument | Nasdaq 100, Daily |
| Spread | 3 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-24 |
| positionSize Contracts per trade | 1 |
| trendPeriod SMA trend filter length | 200 |
| fastPeriod Short SMA for the pullback test and the short exit | 5 |
| exitPeriod SMA whose upward cross closes a long | 9 |
| rsiPeriod RSI length | 2 |
| oversoldLevel Buy below this RSI | 13 |
| overboughtLevel Short above this RSI | 83 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | Daily | 1.99 | 627 | 66.35 | 19,095 EUR | -3,955 |
| S&P 500 | Daily | 1.98 | 855 | 63.39 | 5,527 EUR | -729 |
| USD/JPY | Daily | n/a | 790 | 67.59 | 780,260 JPY | -499,400 |
| EUR/USD | 1 hour | n/a | 10,349 | 64.65 | 53,535 USD | -13,600 |
| EUR/USD | Daily | n/a | 728 | 64.70 | 31,884 USD | -25,885 |
| Nikkei 225 | Daily | n/a | 652 | 66.87 | 29,284 USD | -14,725 |
| EUR/USD | 4 hours | n/a | 2,657 | 63.72 | 29,018 USD | -17,428 |
| Dow Jones | Daily | n/a | 784 | 64.29 | 14,829 EUR | -6,619 |
| US Crude Oil | Daily | n/a | 658 | 65.20 | 7,721 EUR | -6,834 |
| Dow Jones | 4 hours | n/a | 573 | 65.97 | 6,873 EUR | -6,685 |
| FTSE 100 | Daily | n/a | 639 | 66.82 | 4,588 EUR | -2,993 |
Charts
Above 1.0 made money, below 1.0 lost money.
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) Pullback MA Exit // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade trendPeriod = 200 // SMA trend filter length fastPeriod = 5 // short SMA for the pullback test and the short exit exitPeriod = 9 // SMA whose upward cross closes a long rsiPeriod = 2 // RSI length oversoldLevel = 13 // buy below this RSI overboughtLevel = 83 // short above this RSI // --- Indicators --- trendMA = Average[trendPeriod](close) fastMA = Average[fastPeriod](close) exitMA = Average[exitPeriod](close) rsiValue = RSI[rsiPeriod](close)
25 more lines: the entry and exit rules.
Read this first
Questions
Yes, it uses simple moving averages and RSI with market orders. The rewritten code is not compile-checked yet.
S&P 500 Daily had a profit factor of 1.98 and made EUR 5,527.46. EUR/USD 1 hour made USD 53,535.0 and FTSE 100 Daily EUR 4,588.1.
The best run had a max drawdown of EUR 3,955.3 with 1 contract. S&P 500 Daily was milder at EUR 728.74.
RSI(2) dips on Daily bars mark short pullbacks inside the 200 SMA trend. The Nasdaq 100 run produced 627 trades on that setting.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.