It buys when the close is above the close 3 bars ago and above the 200-period SMA, and sells short on the mirror setup. Trades close on a cross of the 20-period SMA or a 1% stop. The results on this page are losses on every market tested.
Best run of 16. Gold, 30 min, spread 0.6, from run sweeps:2026-09-07-GOLD-30m-opt.tsv:16.
| Period | Up to 2026-09-07 |
| 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-07 |
| positionSize Contracts per trade | 1 |
| momentumBars Compare the close with the close this many bars ago | 3 |
| trendPeriod SMA trend filter length | 200 |
| exitPeriod SMA that closes the trade | 20 |
| stopLossPct Protective stop, percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 30 min | n/a | 23,572 | 25.87 | -6,941 EUR | -10,737 |
| Gold | 1 hour | n/a | 13,568 | 25.63 | -4,970 EUR | -6,288 |
| Gold | 5 min | n/a | 22,391 | 22.34 | -10,356 EUR | -10,358 |
| Gold | 15 min | n/a | 22,453 | 21.05 | -11,911 EUR | -12,096 |
| S&P 500 | 1 hour | n/a | 13,544 | 24.39 | -14,786 EUR | -14,995 |
| S&P 500 | 30 min | n/a | 22,612 | 25.37 | -15,207 EUR | -18,100 |
| S&P 500 | 15 min | n/a | 22,025 | 22.84 | -22,026 EUR | -22,032 |
| S&P 500 | 5 min | n/a | 22,052 | 19.01 | -22,731 EUR | -22,752 |
| DAX 40 | 1 hour | n/a | 12,583 | 28.60 | -25,330 EUR | -28,320 |
| Nasdaq 100 | 1 hour | n/a | 13,746 | 23.33 | -41,427 EUR | -42,672 |
| DAX 40 | 30 min | n/a | 22,626 | 27.44 | -43,008 EUR | -51,969 |
| Nasdaq 100 | 30 min | n/a | 23,126 | 24.90 | -43,185 EUR | -47,829 |
| Nasdaq 100 | 15 min | n/a | 22,282 | 25.90 | -54,500 EUR | -54,500 |
| Nasdaq 100 | 5 min | n/a | 22,203 | 23.76 | -64,053 EUR | -64,138 |
| DAX 40 | 5 min | n/a | 22,331 | 22.51 | -67,174 EUR | -67,332 |
| DAX 40 | 15 min | n/a | 22,450 | 25.47 | -75,174 EUR | -75,223 |
Charts
Top 10 of 16 runs. The full list is in the table above.
The code
// ============================================================ // Three Bar Momentum Filtered // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade momentumBars = 3 // compare the close with the close this many bars ago trendPeriod = 200 // SMA trend filter length exitPeriod = 20 // SMA that closes the trade stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- trendMA = Average[trendPeriod](close) exitMA = Average[exitPeriod](close)
25 more lines: the entry and exit rules.
Setup
Questions
The code can run in ProOrder, but no tested market or timeframe was profitable, and the rewritten code was not compile-checked.
DAX 40, Nasdaq 100, S&P 500 and Gold on intraday charts. Gold 1 hour lost the least, ending at EUR -4,970.2.
At 1 contract the Gold 30 minute run drew down EUR 10,737, and Nasdaq 100 5 minutes drew down EUR 64,138.2.
Seeing what fails helps as much as seeing what works. A simple momentum trigger with a trend filter is not enough on its own here.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.