The strategy buys when an RSI of a 50-period linear regression line crosses above its own 50-period EMA while price is above the 200-period EMA. It closes the long when that RSI crosses back below its EMA.
Best run of 31. Gold, Daily, spread 0.6, from run pf:2026-10-12-GOLD-D.tsv:3.
| Period | Up to 2026-10-12 |
| Instrument | Gold, Daily |
| Spread | 0.6 points |
| 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-10-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 3.02 | 111 | 48.65 | 3,282 EUR | -809 |
| Nasdaq 100 | Daily | 2.90 | 124 | 46.77 | 17,038 EUR | -2,905 |
| Gold | 30 min | 1.48 | 1,490 | 39.26 | 3,295 EUR | -570 |
| USD/JPY | 30 min | 1.29 | 1,484 | 41.24 | 675,740 USD | -119,720 |
| DAX 40 | 30 min | 1.22 | 1,606 | 39.85 | 11,774 EUR | -2,401 |
| USD/JPY | Daily | n/a | 92 | 45.65 | 615,660 USD | -293,400 |
| USD/JPY | 1 hour | n/a | 1,049 | 41.28 | 389,190 USD | -186,460 |
| USD/JPY | 15 min | n/a | 1,641 | 36.68 | 206,510 USD | -144,650 |
| USD/JPY | 10 min | n/a | 1,726 | 37.25 | 197,880 USD | -124,360 |
| EUR/USD | Daily | n/a | 82 | 51.22 | 108,235 USD | -38,022 |
| Silver | 30 min | n/a | 1,502 | 36.82 | 27,139 USD | -12,287 |
| Nikkei 225 | Daily | n/a | 97 | 44.33 | 24,189 USD | -9,477 |
| Nikkei 225 | 30 min | n/a | 1,503 | 37.79 | 21,243 USD | -6,328 |
| Silver | 4 hours | n/a | 217 | 44.24 | 18,862 USD | -14,759 |
| Nikkei 225 | 4 hours | n/a | 231 | 38.53 | 14,764 USD | -11,662 |
| Silver | 3 min | n/a | 1,696 | 32.90 | 11,100 USD | -9,620 |
| Dow Jones | Daily | n/a | 161 | 42.24 | 8,487 EUR | -7,218 |
| GBP/USD | Daily | n/a | 91 | 43.96 | 7,619 USD | -3,748 |
| US Crude Oil | 30 min | n/a | 1,281 | 39.81 | 6,434 EUR | -2,827 |
| Nasdaq 100 | 30 min | n/a | 1,765 | 40.57 | 6,363 EUR | -4,169 |
| DAX 40 | 1 hour | n/a | 965 | 41.24 | 6,097 EUR | -3,346 |
| Brent Crude | Daily | n/a | 30 | 43.33 | 5,673 EUR | -5,566 |
| Brent Crude | 30 min | n/a | 971 | 39.24 | 5,425 EUR | -2,351 |
| Nasdaq 100 | 15 min | n/a | 1,704 | 39.20 | 3,702 EUR | -3,161 |
| Gold | 4 hours | n/a | 247 | 42.51 | 2,009 EUR | -718 |
| Gold | 1 hour | n/a | 924 | 40.69 | 1,651 EUR | -1,167 |
| S&P 500 | Daily | n/a | 161 | 43.48 | 1,524 EUR | -626 |
| S&P 500 | 30 min | n/a | 1,731 | 40.61 | 1,059 EUR | -786 |
| Gold | 10 min | n/a | 1,598 | 36.36 | 1,008 EUR | -528 |
| Gold | 3 min | n/a | 1,618 | 34.30 | 935 EUR | -457 |
| Gold | 5 min | n/a | 1,669 | 35.17 | 889 EUR | -495 |
Charts
Top 10 of 31 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Linear Regression RSI Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false lr = LinearRegression[50](close) myRsi = RSI[21](lr) ema = ExponentialAverage[50](myRsi) trend = ExponentialAverage[200](close)
13 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 31 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 3.02 over 111 trades.
The best run had a maximum drawdown of 809 EUR at the tested position size, against a net result of 3,282 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.