It buys when a short ALMA of log returns is at least 0.0002 above a long one and close is above a 200 EMA. It sells when the short ALMA falls below the long one and low is at or below the prior low.
Best run of 29. Gold, 4 hours, spread 0.6, from run pf:2026-10-12-GOLD-4h.tsv:13.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 4 hours |
| Spread | 0.6 points |
| 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-10-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | 1.50 | 707 | 40.17 | 2,740 EUR | -624 |
| USD/JPY | Daily | n/a | 296 | 32.09 | 641,290 USD | -299,180 |
| USD/JPY | 1 hour | n/a | 1,743 | 42.80 | 565,280 USD | -141,350 |
| USD/JPY | 30 min | n/a | 1,582 | 41.72 | 172,450 USD | -129,280 |
| Silver | Daily | n/a | 303 | 32.67 | 27,467 USD | -26,267 |
| Nikkei 225 | Daily | n/a | 313 | 38.98 | 24,551 USD | -10,943 |
| Nikkei 225 | 1 hour | n/a | 1,931 | 37.80 | 13,714 USD | -8,395 |
| Nikkei 225 | 3 min | n/a | 1,227 | 40.02 | 13,659 USD | -5,261 |
| GBP/USD | Daily | n/a | 304 | 40.13 | 12,115 USD | -4,959 |
| Nikkei 225 | 4 hours | n/a | 654 | 36.39 | 11,834 USD | -9,616 |
| DAX 40 | Daily | n/a | 465 | 38.92 | 11,627 EUR | -3,552 |
| Nasdaq 100 | Daily | n/a | 385 | 39.22 | 11,207 EUR | -4,378 |
| Nikkei 225 | 2 min | n/a | 1,056 | 41.95 | 10,536 USD | -6,454 |
| Dow Jones | Daily | n/a | 468 | 40.38 | 10,375 EUR | -6,328 |
| DAX 40 | 4 hours | n/a | 748 | 40.24 | 10,116 EUR | -3,668 |
| Dow Jones | 4 hours | n/a | 258 | 36.82 | 8,352 EUR | -4,424 |
| Nikkei 225 | 1 min | n/a | 650 | 41.08 | 8,081 USD | -4,034 |
| Nasdaq 100 | 4 hours | n/a | 831 | 41.03 | 6,273 EUR | -3,163 |
| Dow Jones | 1 hour | n/a | 732 | 41.26 | 5,997 EUR | -3,862 |
| Nasdaq 100 | 15 min | n/a | 2,371 | 41.37 | 5,453 EUR | -3,737 |
| Nasdaq 100 | 30 min | n/a | 3,039 | 41.40 | 5,053 EUR | -4,056 |
| DAX 40 | 1 hour | n/a | 2,141 | 39.19 | 4,357 EUR | -2,479 |
| Nasdaq 100 | 5 min | n/a | 1,095 | 42.10 | 3,378 EUR | -1,623 |
| Nasdaq 100 | 3 min | n/a | 812 | 42.98 | 2,295 EUR | -1,348 |
| Gold | Daily | n/a | 349 | 38.68 | 2,026 EUR | -1,061 |
| S&P 500 | Daily | n/a | 504 | 36.51 | 1,220 EUR | -814 |
| Gold | 1 hour | n/a | 2,164 | 37.38 | 1,154 EUR | -514 |
| S&P 500 | 4 hours | n/a | 813 | 40.10 | 740 EUR | -635 |
| Gold | 5 min | n/a | 1,359 | 40.62 | 713 EUR | -377 |
Charts
Top 10 of 29 runs. The full list is in the table above.
The code
// ============================================================== // ALMA Log Return Momentum // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false lr = 0
35 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 29 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 1.50 over 707 trades.
The best run had a maximum drawdown of 624 EUR at the tested position size, against a net result of 2,740 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.