Join today
Strategies / Trend / SMA Cross 10/30

SMA Cross 10/30: Testing a Fast Moving Average Cross

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.

TrendLong & shortSwingGold1 hour
1.14Profit factor
2,045Net profit EUR
34.23%Win rate
2,495Trades
-867Max drawdown
0.82Avg trade

Best run of 16. Gold, 1 hour, spread 0.6, from run pf:2026-09-15-GOLD-1h.tsv:4.

Entry rules, long

  1. Members only
  2. No position is open

Entry rules, short

  1. Members only
  2. No position is open

Exit rules

  1. Stop loss at 1% from entry
  2. Members only
  3. Close a short when the 10 SMA is back above the 30 SMA

Test conditions

PeriodUp to 2026-09-15
InstrumentGold, 1 hour
Spread0.6 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-15

Parameters

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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run1 hour1.14 2,49534.232,045 EUR-867
Gold30 minn/a 4,12331.53267 EUR-2,007
DAX 401 hourn/a 2,44434.08195 EUR-5,535
Gold15 minn/a 3,92429.46-910 EUR-2,607
Gold5 minn/a 3,99029.25-1,736 EUR-2,381
S&P 5005 minn/a 3,88028.58-3,017 EUR-3,082
S&P 5001 hourn/a 2,63330.69-3,363 EUR-3,748
S&P 50015 minn/a 4,02229.99-4,123 EUR-4,891
S&P 50030 minn/a 4,18630.75-4,646 EUR-5,045
Nasdaq 1001 hourn/a 2,72330.33-6,089 EUR-7,907
DAX 4015 minn/a 4,00032.45-8,056 EUR-8,617
DAX 4030 minn/a 4,12132.71-8,861 EUR-9,010
DAX 405 minn/a 3,96830.12-9,657 EUR-10,304
Nasdaq 10030 minn/a 4,28331.61-10,065 EUR-12,801
Nasdaq 10015 minn/a 3,97731.15-11,904 EUR-15,260
Nasdaq 1005 minn/a 3,90830.27-15,416 EUR-15,493

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-20K-10K1K3KGold · 1 hourGold · 30 minDAX 40 · 1 hourGold · 15 minGold · 5 minS&P 500 · 5 minS&P 500 · 1 hourS&P 500 · 15 minS&P 500 · 30 minNasdaq 100 · 1 hourDAX 40 · 15 minDAX 40 · 30 minDAX 40 · 5 minNasdaq 100 · 30 minNasdaq 100 · 15 minNasdaq 100 · 5 min

The code

ProBuilder, rewritten to house standard

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.

// ============================================================
// 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.

Read this first

Known weaknesses

  • Only 2 of the 15 extra runs made money, and the rest lost, including Nasdaq 100 5 minutes at -15,416.10 EUR.
  • The best run on Gold 1 hour has a profit factor of 1.14 and an average trade of 0.82 EUR, barely above zero.
  • Win rates sit around 30% (34.23% in the best run), so long losing streaks are expected.
  • The extra runs only have sweep data, so profit factor was not recorded for them.

Indicators used

SMA

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Can it be traded in ProOrder?

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.

How did it do on each market?

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.

What drawdown at 1 contract?

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.

Does timeframe matter?

Yes. The 1 hour chart gave the best result on Gold and DAX 40, while the 5 minute runs lost on every instrument.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Triple Band Market Model

Best run on the same market, Gold.

2.27 PF · 203 trades

MACD Zero Cross

A similar profit factor.

1.14 PF · 2,724 trades

Want to see which crossover variants hold up? Join the ProRealAlgos waitlist.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs