It buys when the close 21 bars ago is above the close 252 bars ago, a trend signal that ignores the most recent 21 bars. It closes when the close 21 bars ago falls below the close 252 bars ago.
Best run of 3. Gold, Daily, spread 0.6, from run pf:2026-10-11-GOLD-D.tsv:2.
| Period | Up to 2026-10-11 |
| Instrument | Gold, Daily |
| 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-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 3.93 | 155 | 42.58 | 54,675 EUR | -23,902 |
| USD/JPY | Daily | 2.54 | 22 | 45.45 | 1,580 USD | -1,016 |
| EUR/USD | Daily | 1.55 | 137 | 36.50 | 4,586 USD | -3,332 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Lagged Momentum Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE capital = 10000
18 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 3 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 3.93 over 155 trades.
The best run had a maximum drawdown of 23,902 EUR at the tested position size, against a net result of 54,675 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.