The system compares 5 bar momentum with 100 bar momentum and the 4 bar average range with the 100 bar average range. When both short readings jump well above the long ones on an up close with a rising 18 EMA, it buys. It takes profit at 43 points or later exits once the 53 EMA turns down.
Best run of 13. DAX 40, 30 min, spread 3, from run sweeps:2026-09-26-DAX40-30m-opt.tsv:2.
| Period | Up to 2026-09-26 |
| Instrument | DAX 40, 30 minutes |
| 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-26 |
| positionSize Contracts per trade | 1 |
| takeProfitPoints Profit target in points | 43 |
| minBarsInTrade Earliest bar after entry that the trend exit may fire | 43 |
| momentumShortPeriod Short momentum length | 5 |
| momentumLongPeriod Long momentum length | 100 |
| rangeShortPeriod Short average range length | 4 |
| rangeLongPeriod Long average range length | 100 |
| momentumThreshold Minimum momentum differential to buy | 2 |
| rangeThreshold Minimum range differential to buy | 8.5 |
| fastPeriod Fast EMA length, must be rising to buy | 18 |
| slowPeriod Slow EMA length, falling slow EMA ends the trade | 53 |
| entryBar Bar index of the last entry | 0 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 30 min | n/a | 1,512 | 75.20 | 4,949 EUR | -4,212 |
| Silver | 4 hours | n/a | 91 | 74.73 | 4,943 USD | -3,351 |
| DAX 40 | Daily | n/a | 111 | 98.20 | 3,659 EUR | -1,340 |
| DAX 40 | 1 hour | n/a | 967 | 83.45 | 3,223 EUR | -2,221 |
| FTSE 100 | Daily | n/a | 104 | 94.23 | 1,964 EUR | -1,193 |
| DAX 40 | 2 min | n/a | 428 | 63.55 | 1,609 EUR | -1,186 |
| DAX 40 | 5 min | n/a | 699 | 70.10 | 1,607 EUR | -1,032 |
| S&P 500 | 1 hour | n/a | 172 | 62.21 | 776 EUR | -508 |
| Gold | 5 min | n/a | 29 | 68.97 | 446 EUR | -104 |
| FTSE 100 | 2 min | n/a | 66 | 51.52 | 280 EUR | -169 |
| Gold | 4 hours | n/a | 21 | 66.67 | 280 EUR | -246 |
| FTSE 100 | 1 min | n/a | 40 | 57.50 | 202 EUR | -195 |
| Gold | 1 min | n/a | 9 | 55.56 | 103 EUR | -89.90 |
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.
// ============================================================ // Momentum Range Differential // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade takeProfitPoints = 43 // profit target in points minBarsInTrade = 43 // earliest bar after entry that the trend exit may fire momentumShortPeriod = 5 // short momentum length momentumLongPeriod = 100 // long momentum length rangeShortPeriod = 4 // short average range length rangeLongPeriod = 100 // long average range length momentumThreshold = 2 // minimum momentum differential to buy rangeThreshold = 8.5 // minimum range differential to buy fastPeriod = 18 // fast EMA length, must be rising to buy slowPeriod = 53 // slow EMA length, falling slow EMA ends the trade ONCE entryBar = 0 // bar index of the last entry // --- Indicators --- // Momentum differential: how much the short-term move outpaces the long-term one. momentumShort = Momentum[momentumShortPeriod](close) momentumLong = Momentum[momentumLongPeriod](close) momentumDiff = MAX(ABS(momentumShort) - ABS(momentumLong), 0) // Range differential: how much recent bars are wider than usual. barRange = ABS(Range) avgRangeLong = Average[MAX(1, rangeLongPeriod)](barRange) avgRangeShort = Average[MAX(1, rangeShortPeriod)](barRange) rangeDiff = MAX(0, avgRangeShort - avgRangeLong) upBar = close > open fastMA = ExponentialAverage[fastPeriod](close) slowMA = ExponentialAverage[slowPeriod](close)
23 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is a long only ProOrder system with a points target. The rewritten code has not been compile checked yet.
All 12 listed runs were profitable, on DAX 40, FTSE 100, Gold, S&P 500 and Silver. Results beyond the DAX 40 were mostly small, for example EUR 776.36 on S&P 500 1 hour.
The best run reached EUR 4,212.3 drawdown. With no stop, a single bad trade could exceed it.
The 43 point target suits the typical DAX 40 move over a few 30 minute bars, and that timeframe gave the most trades, 1,512.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.