Longs open when the 60 EMA crosses above the 200 EMA, and shorts open when the 40 EMA crosses below the 300 EMA. Each side closes on the reverse cross of its own pair, or at a 400 point stop or 200 point target. Weekend bars are skipped.
Best run of 20. Gold, 30 min, spread 0.6, from run pf:2026-09-24-GOLD-30m.tsv:1.
| Period | Up to 2026-09-25 |
| 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-25 |
| positionSize Contracts per trade | 1 |
| longFastPeriod Fast EMA for the long side | 60 |
| longSlowPeriod Slow EMA for the long side | 200 |
| shortFastPeriod Fast EMA for the short side | 40 |
| shortSlowPeriod Slow EMA for the short side | 300 |
| stopLossPoints Protective stop in points | 400 |
| takeProfitPoints Profit target in points | 200 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | 1.33 | 1,019 | 28.16 | 3,335 EUR | -773 |
| USD/JPY | 4 hours | n/a | 205 | 44.88 | 345,860 JPY | -131,940 |
| USD/JPY | 10 min | n/a | 987 | 28.37 | 240,130 JPY | -120,560 |
| USD/JPY | 5 min | n/a | 1,030 | 27.77 | 154,330 JPY | -137,950 |
| USD/JPY | 3 min | n/a | 1,064 | 26.88 | 137,960 JPY | -108,820 |
| Nikkei 225 | 2 min | n/a | 1,027 | 49.46 | 12,793 USD | -4,641 |
| Nikkei 225 | 1 hour | n/a | 536 | 59.33 | 10,026 USD | -3,710 |
| Dow Jones | 1 hour | n/a | 211 | 66.82 | 6,204 EUR | -2,411 |
| Dow Jones | 30 min | n/a | 407 | 58.97 | 5,744 EUR | -2,820 |
| Nasdaq 100 | 4 hours | n/a | 153 | 49.02 | 4,270 EUR | -1,180 |
| DAX 40 | 4 hours | n/a | 153 | 64.05 | 3,274 EUR | -3,151 |
| GBP/USD | 4 hours | n/a | 259 | 50.97 | 3,191 USD | -2,485 |
| Nikkei 225 | Daily | n/a | 42 | 76.19 | 2,400 USD | -1,383 |
| Gold | 3 min | n/a | 1,061 | 26.58 | 2,324 EUR | -721 |
| Gold | 15 min | n/a | 1,094 | 26.05 | 1,705 EUR | -701 |
| Gold | 4 hours | n/a | 169 | 30.18 | 1,653 EUR | -591 |
| Gold | 2 min | n/a | 1,061 | 27.43 | 1,521 EUR | -654 |
| Gold | 5 min | n/a | 1,044 | 26.92 | 1,469 EUR | -668 |
| S&P 500 | Daily | n/a | 51 | 47.06 | 1,430 EUR | -815 |
| Gold | Daily | n/a | 48 | 37.50 | 763 EUR | -543 |
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.
// ============================================================ // Asymmetric EMA Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade longFastPeriod = 60 // fast EMA for the long side longSlowPeriod = 200 // slow EMA for the long side shortFastPeriod = 40 // fast EMA for the short side shortSlowPeriod = 300 // slow EMA for the short side stopLossPoints = 400 // protective stop in points takeProfitPoints = 200 // profit target in points // --- Indicators --- weekendBar = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0 longFastMA = ExponentialAverage[longFastPeriod](close) longSlowMA = ExponentialAverage[longSlowPeriod](close) shortFastMA = ExponentialAverage[shortFastPeriod](close) shortSlowMA = ExponentialAverage[shortSlowPeriod](close)
27 more lines: the entry and exit rules.
Read this first
Questions
Yes. The crosses, stop and target are all coded, so it runs unattended. The stats come from the pre-rewrite version, so test the new code in demo first.
Gold on 30 minutes was the best run with 3,335.10 EUR net over 1019 trades. It was also profitable on USD/JPY, Nikkei 225, Dow Jones, Nasdaq 100, DAX 40, GBP/USD and S&P 500 in the runs shown.
One contract per trade with a 0.6 point spread. The Gold 30 minute run had a max drawdown of 772.95 EUR.
Markets tend to fall faster than they rise, so the short side uses a quicker 40 EMA against a slower 300 EMA. The long side waits for the more common 60/200 cross.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.