The strategy buys when the 2 day SMA falls today, was rising 10 days ago, and the close is still above the 7 day SMA. It sells as soon as the 2 day SMA stops falling. A 100 point stop limits each trade.
Best run of 10. Nasdaq 100, Daily, spread 3, from run pf:2026-09-24-NAS100-D.tsv:3.
| Period | Up to 2026-09-25 |
| 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-25 |
| positionSize Contracts per trade | 1 |
| fastPeriod Short SMA length | 2 |
| slowPeriod Filter SMA length | 7 |
| stopLossPoints Protective stop, points | 100 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | Daily | 1.41 | 561 | 50.80 | 4,455 EUR | -1,080 |
| S&P 500 | Daily | 1.38 | 770 | 57.66 | 1,353 EUR | -289 |
| Nikkei 225 | Daily | 1.36 | 611 | 39.28 | 13,355 USD | -1,800 |
| USD/JPY | Daily | n/a | 635 | 59.06 | 471,490 JPY | -143,650 |
| USD/JPY | 4 hours | n/a | 1,722 | 64.40 | 262,220 JPY | -95,640 |
| EUR/USD | 3 min | n/a | 7,854 | 32.73 | 78,110 USD | -47,743 |
| EUR/USD | Daily | n/a | 593 | 58.68 | 17,520 USD | -10,935 |
| Dow Jones | Daily | n/a | 721 | 53.54 | 5,296 EUR | -1,525 |
| Brent Crude | Daily | n/a | 261 | 45.98 | 2,076 EUR | -1,828 |
| Gold | Daily | n/a | 653 | 57.27 | 732 EUR | -277 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================ // Two Day Buy and Hold // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long only // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fastPeriod = 2 // very short SMA that measures the dip slowPeriod = 7 // close must be above this SMA stopLossPoints = 100 // protective stop, in points // --- Indicators --- fastMA = Average[fastPeriod](close) slowMA = Average[slowPeriod](close)
17 more lines: the entry and exit rules.
Setup
Questions
Yes. It is a long only system with a points stop and an SMA based exit. The rewrite needs a compile check.
Nasdaq 100, S&P 500, Nikkei 225, USD/JPY, EUR/USD, Dow Jones, Brent Crude and Gold, all profitable. S&P 500 Daily made EUR 1,352.51 with a profit factor of 1.38.
The best run had a max drawdown of EUR 1,079.9 on Nasdaq 100 Daily. USD/JPY Daily reached JPY 143,650.
The rule looks at day to day SMA changes and a trend check 10 days back, so it is built around daily swings.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.