A classic crossover: buy when the 50 EMA crosses above the 200 EMA, short when it crosses below. The trade closes when the averages flip back or a 1% stop is hit.
Best run of 17. Gold, 30 min, spread 0.6, from run pf:2026-09-15-GOLD-30m.tsv:2.
| Period | Up to 2026-09-15 |
| Instrument | Gold, 30 minutes |
| 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 EMA length | 50 |
| slowPeriod Slow EMA length | 200 |
| stopLossPct Protective stop as percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | 1.39 | 697 | 26.11 | 2,578 EUR | -862 |
| Nasdaq 100 | 15 min | n/a | 680 | 29.85 | 4,705 EUR | -8,595 |
| Nasdaq 100 | 30 min | n/a | 785 | 25.35 | 4,060 EUR | -5,226 |
| DAX 40 | 15 min | n/a | 690 | 25.65 | 2,889 EUR | -6,063 |
| S&P 500 | 2 hours | n/a | 261 | 23.37 | 2,269 EUR | -1,766 |
| Gold | 5 min | n/a | 595 | 28.40 | 901 EUR | -986 |
| Gold | 1 hour | n/a | 484 | 24.38 | 807 EUR | -1,321 |
| S&P 500 | 30 min | n/a | 714 | 27.31 | 644 EUR | -1,718 |
| Gold | 15 min | n/a | 685 | 26.13 | 514 EUR | -1,644 |
| S&P 500 | 1 hour | n/a | 502 | 24.10 | 480 EUR | -1,540 |
| DAX 40 | 5 min | n/a | 576 | 30.21 | -283 EUR | -5,098 |
| S&P 500 | 5 min | n/a | 582 | 26.12 | -816 EUR | -1,629 |
| S&P 500 | 15 min | n/a | 643 | 27.99 | -990 EUR | -2,070 |
| DAX 40 | 30 min | n/a | 805 | 23.85 | -1,817 EUR | -8,593 |
| Nasdaq 100 | 1 hour | n/a | 556 | 21.58 | -2,509 EUR | -8,933 |
| Nasdaq 100 | 5 min | n/a | 627 | 25.52 | -5,043 EUR | -7,459 |
| DAX 40 | 1 hour | n/a | 543 | 21.73 | -6,357 EUR | -8,613 |
Charts
The code
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.
// ============================================================ // EMA Cross 50/200 // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade fastPeriod = 50 // fast EMA length slowPeriod = 200 // slow EMA length stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- fastMA = ExponentialAverage[fastPeriod](close) slowMA = ExponentialAverage[slowPeriod](close)
26 more lines: the entry and exit rules.
Read this first
Questions
Yes, it trades 1 contract per signal with a 1% stop and reverses exposure only through a new crossover after the exit.
Gold 30 minutes had a profit factor of 1.39. Nasdaq 100 15 minutes made EUR 4,704.70 but with a EUR 8,594.70 drawdown, and DAX 40 was mostly negative.
The maximum drawdown was EUR 862.20 at 1 contract, against EUR 2,578.10 net profit.
On a 30 minute chart the 200 EMA spans several days, so crosses mark multi day swings without holding overnight for months.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.