Two exponential averages, 20 and 50 periods, give the direction, and a trade is taken only when ADX(14) reads above 25 at the moment of the cross. It trades both long and short and stays in until the averages cross back or a 1% stop is hit.
Best run of 16. Nasdaq 100, 1 hour, spread 3, from run pf:2026-09-15-NAS100-1h.tsv:1.
| Period | Up to 2026-09-15 |
| Instrument | Nasdaq 100, 1 hour |
| 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-15 |
| positionSize Contracts per trade | 1 |
| fastPeriod Fast EMA length | 20 |
| slowPeriod Slow EMA length | 50 |
| adxPeriod ADX length | 14 |
| adxThreshold Minimum ADX reading to take a cross | 25 |
| stopLossPct Protective stop as percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | 1 hour | 1.15 | 607 | 26.19 | 3,805 EUR | -3,530 |
| Nasdaq 100 | 5 min | 1.13 | 650 | 31.69 | 3,397 EUR | -2,190 |
| DAX 40 | 30 min | n/a | 734 | 33.38 | 3,275 EUR | -3,460 |
| DAX 40 | 15 min | n/a | 695 | 30.79 | 950 EUR | -2,725 |
| Nasdaq 100 | 15 min | n/a | 816 | 29.41 | 778 EUR | -5,197 |
| Gold | 1 hour | n/a | 526 | 27.57 | 530 EUR | -843 |
| S&P 500 | 30 min | n/a | 717 | 28.59 | -97.07 EUR | -1,509 |
| S&P 500 | 5 min | n/a | 626 | 27.64 | -119 EUR | -626 |
| Gold | 5 min | n/a | 571 | 29.07 | -375 EUR | -722 |
| Nasdaq 100 | 30 min | n/a | 787 | 28.34 | -558 EUR | -4,518 |
| S&P 500 | 1 hour | n/a | 553 | 27.49 | -609 EUR | -1,521 |
| S&P 500 | 15 min | n/a | 757 | 28.67 | -717 EUR | -1,269 |
| Gold | 30 min | n/a | 673 | 27.49 | -794 EUR | -1,145 |
| Gold | 15 min | n/a | 665 | 26.92 | -1,683 EUR | -1,797 |
| DAX 40 | 5 min | n/a | 598 | 27.42 | -2,462 EUR | -4,023 |
| DAX 40 | 1 hour | n/a | 490 | 26.94 | -3,949 EUR | -6,854 |
Charts
Above 1.0 made money, below 1.0 lost money.
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.
// ============================================================ // ADX Filtered EMA Cross // 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 = 20 // fast EMA length slowPeriod = 50 // slow EMA length adxPeriod = 14 // ADX length adxThreshold = 25 // only trade crosses when the trend is this strong stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- fastMA = ExponentialAverage[fastPeriod](close) slowMA = ExponentialAverage[slowPeriod](close) adxValue = ADX[adxPeriod]
26 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is a standard ProOrder system with a fixed stop. The code was rewritten after testing and has not been compile-checked yet, and the stats come from the version before the rewrite, so run it in demo first.
Nasdaq 100 on 1 hour gave the best run, EUR 3,805 over 607 trades with a profit factor of 1.15. DAX 40 on 30 minutes also made EUR 3,274.50, while all four S&P 500 timeframes and most Gold timeframes lost.
At 1 contract per trade the best run had a max drawdown of EUR 3,530.20. Margin depends on your broker, so size your account around that drawdown, not around the profit figure.
A plain EMA cross gets whipsawed in sideways markets. Requiring ADX(14) above 25 skips crosses that happen when there is no trend, which is where most of those losses come from.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.