Buys when close crosses above the 200-period SMA, or when it is above that average and crosses above the 20-period SMA, while flat. Closes the long when close crosses below the 20-period SMA, with a 5% stop below entry.
Best run of 17. EUR/USD, 2 min, spread 1, from run sweeps:2026-10-10-EURUSD-2m-opt.tsv:5.
| Period | Up to 2026-10-10 |
| Instrument | EUR/USD, 2 minutes |
| Spread | 1 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-10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 2 min | n/a | 7,801 | 17.66 | 198,595 USD | -126,329 |
| USD/JPY | Daily | n/a | 453 | 28.26 | 705,600 USD | -537,050 |
| USD/JPY | 4 hours | n/a | 1,304 | 29.60 | 353,970 USD | -275,210 |
| EUR/USD | 5 min | n/a | 7,607 | 20.97 | 84,403 USD | -75,490 |
| Nikkei 225 | Daily | n/a | 451 | 31.49 | 22,606 USD | -12,376 |
| Silver | 4 hours | n/a | 1,075 | 28.47 | 20,533 USD | -19,005 |
| Nikkei 225 | 4 hours | n/a | 1,064 | 30.73 | 17,853 USD | -10,756 |
| Dow Jones | 4 hours | n/a | 430 | 33.02 | 16,093 EUR | -4,074 |
| Dow Jones | Daily | n/a | 683 | 34.70 | 14,427 EUR | -5,983 |
| Nasdaq 100 | Daily | n/a | 546 | 32.97 | 12,894 EUR | -5,183 |
| GBP/USD | Daily | n/a | 478 | 34.10 | 11,879 USD | -4,722 |
| DAX 40 | 4 hours | n/a | 1,225 | 32.65 | 10,679 EUR | -3,373 |
| Nasdaq 100 | 4 hours | n/a | 1,298 | 31.43 | 9,309 EUR | -4,278 |
| DAX 40 | Daily | n/a | 628 | 32.80 | 6,078 EUR | -5,489 |
| Gold | 4 hours | n/a | 1,104 | 30.80 | 2,512 EUR | -821 |
| S&P 500 | Daily | n/a | 713 | 32.12 | 1,995 EUR | -1,137 |
| S&P 500 | 4 hours | n/a | 1,384 | 32.88 | 1,494 EUR | -969 |
Charts
Top 10 of 17 runs. The full list is in the table above.
The code
// ============================================================== // Moving Average Trend Entry // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 2 minutes // ============================================================== DEFPARAM CumulateOrders = false smalong = Average[200](close) smashort = Average[20](close)
14 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 17 market and timeframe combinations. The best run by trade count was EUR/USD, 2 minutes, with 7,801 trades.
The best run had a maximum drawdown of 126,329 USD at the tested position size, against a net result of 198,595 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.