When the 10-period SMA crosses the 30-period SMA the system trades in the direction of the cross. Positions close on the reverse cross or at a 1% stop.
Best run of 16. Gold, 1 hour, spread 0.6, from run pf:2026-09-15-GOLD-1h.tsv:4.
| Period | Up to 2026-09-15 |
| Instrument | Gold, 1 hour |
| 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-15 |
| positionSize Contracts per trade | 1 |
| fastPeriod Fast SMA length | 10 |
| slowPeriod Slow SMA length | 30 |
| stopLossPct Protective stop as percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 1 hour | 1.14 | 2,495 | 34.23 | 2,045 EUR | -867 |
| Gold | 30 min | n/a | 4,123 | 31.53 | 267 EUR | -2,007 |
| DAX 40 | 1 hour | n/a | 2,444 | 34.08 | 195 EUR | -5,535 |
| Gold | 15 min | n/a | 3,924 | 29.46 | -910 EUR | -2,607 |
| Gold | 5 min | n/a | 3,990 | 29.25 | -1,736 EUR | -2,381 |
| S&P 500 | 5 min | n/a | 3,880 | 28.58 | -3,017 EUR | -3,082 |
| S&P 500 | 1 hour | n/a | 2,633 | 30.69 | -3,363 EUR | -3,748 |
| S&P 500 | 15 min | n/a | 4,022 | 29.99 | -4,123 EUR | -4,891 |
| S&P 500 | 30 min | n/a | 4,186 | 30.75 | -4,646 EUR | -5,045 |
| Nasdaq 100 | 1 hour | n/a | 2,723 | 30.33 | -6,089 EUR | -7,907 |
| DAX 40 | 15 min | n/a | 4,000 | 32.45 | -8,056 EUR | -8,617 |
| DAX 40 | 30 min | n/a | 4,121 | 32.71 | -8,861 EUR | -9,010 |
| DAX 40 | 5 min | n/a | 3,968 | 30.12 | -9,657 EUR | -10,304 |
| Nasdaq 100 | 30 min | n/a | 4,283 | 31.61 | -10,065 EUR | -12,801 |
| Nasdaq 100 | 15 min | n/a | 3,977 | 31.15 | -11,904 EUR | -15,260 |
| Nasdaq 100 | 5 min | n/a | 3,908 | 30.27 | -15,416 EUR | -15,493 |
Charts
Top 10 of 16 runs. The full list is in the table above.
The code
// ============================================================ // SMA Cross 10/30 // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 1 hour // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fastPeriod = 10 // fast SMA length slowPeriod = 30 // slow SMA length stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- fastMA = Average[fastPeriod](close) slowMA = Average[slowPeriod](close)
26 more lines: the entry and exit rules.
Setup
Questions
Yes, the cross and stop are coded. Based on these tests, it works better as a baseline to compare other systems against than as a finished system.
Gold 1 hour made 2,045.30 EUR over 2495 trades. Gold 30 minutes and DAX 40 1 hour were slightly positive, while every S&P 500 and Nasdaq 100 run lost.
With 1 contract and a 0.6 point spread, Gold 1 hour had a max drawdown of 866.50 EUR. Nasdaq 100 5 minutes reached 15,492.80 EUR.
Yes. The 1 hour chart gave the best result on Gold and DAX 40, while the 5 minute runs lost on every instrument.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.