Buys after a green, red, green candle sequence where all prices sit above the current highest of the 20, 40 and 80 period averages, with the 20 period average above the other two. Closes the long when a bar's range spans the 80 period average.
Best run of 37. Gold, 4 hours, spread 0.6, from run pf:2026-10-04-GOLD-4h.tsv:9.
| Period | Up to 2026-10-04 |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | 2.09 | 225 | 40.00 | 2,802 EUR | -646 |
| Nikkei 225 | 1 hour | 1.36 | 682 | 34.60 | 27,656 USD | -6,082 |
| DAX 40 | 1 hour | 1.28 | 849 | 36.51 | 11,012 EUR | -2,670 |
| Nasdaq 100 | 15 min | 1.20 | 1,476 | 34.69 | 10,026 EUR | -2,467 |
| USD/JPY | Daily | n/a | 95 | 37.89 | 966,770 USD | -349,850 |
| USD/JPY | 1 hour | n/a | 998 | 34.77 | 476,380 USD | -270,910 |
| USD/JPY | 30 min | n/a | 1,386 | 35.86 | 450,280 USD | -175,640 |
| USD/JPY | 15 min | n/a | 1,437 | 32.99 | 275,530 USD | -122,970 |
| USD/JPY | 10 min | n/a | 1,489 | 32.57 | 247,860 USD | -108,500 |
| EUR/USD | Daily | n/a | 88 | 40.91 | 33,167 USD | -27,990 |
| Nikkei 225 | 30 min | n/a | 1,318 | 34.14 | 23,056 USD | -8,095 |
| Nasdaq 100 | Daily | n/a | 94 | 45.74 | 14,464 EUR | -2,429 |
| Silver | 1 hour | n/a | 830 | 30.72 | 14,321 USD | -14,303 |
| Dow Jones | 1 hour | n/a | 299 | 38.46 | 10,693 EUR | -7,937 |
| Nikkei 225 | 15 min | n/a | 1,359 | 32.16 | 10,530 USD | -8,405 |
| Brent Crude | Daily | n/a | 36 | 36.11 | 9,366 EUR | -4,531 |
| Nasdaq 100 | 1 hour | n/a | 944 | 34.53 | 8,944 EUR | -3,134 |
| Nasdaq 100 | 10 min | n/a | 1,436 | 34.68 | 7,283 EUR | -4,296 |
| DAX 40 | Daily | n/a | 81 | 41.98 | 6,990 EUR | -4,207 |
| US Crude Oil | Daily | n/a | 94 | 32.98 | 6,504 EUR | -4,694 |
| DAX 40 | 30 min | n/a | 1,438 | 32.82 | 5,562 EUR | -3,096 |
| Nasdaq 100 | 4 hours | n/a | 269 | 37.92 | 5,134 EUR | -4,061 |
| Brent Crude | 1 hour | n/a | 464 | 36.21 | 5,052 EUR | -4,270 |
| Nasdaq 100 | 5 min | n/a | 1,467 | 32.99 | 4,368 EUR | -2,753 |
| DAX 40 | 15 min | n/a | 1,502 | 32.62 | 3,938 EUR | -3,194 |
| Gold | 1 hour | n/a | 844 | 37.91 | 2,698 EUR | -698 |
| Gold | Daily | n/a | 93 | 38.71 | 2,305 EUR | -929 |
| S&P 500 | Daily | n/a | 120 | 40.00 | 2,209 EUR | -737 |
| Gold | 30 min | n/a | 1,314 | 32.27 | 1,535 EUR | -573 |
| Gold | 15 min | n/a | 1,378 | 31.35 | 1,430 EUR | -660 |
| S&P 500 | 4 hours | n/a | 265 | 42.26 | 1,429 EUR | -507 |
| Gold | 5 min | n/a | 1,426 | 30.79 | 1,083 EUR | -388 |
| S&P 500 | 30 min | n/a | 1,339 | 34.80 | 1,048 EUR | -1,030 |
| S&P 500 | 1 hour | n/a | 937 | 35.54 | 941 EUR | -572 |
| Gold | 10 min | n/a | 1,376 | 30.89 | 910 EUR | -523 |
| Gold | 3 min | n/a | 1,359 | 29.80 | 660 EUR | -563 |
| Gold | 2 min | n/a | 1,336 | 29.79 | 632 EUR | -447 |
Charts
Top 10 of 37 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Three Candle Moving Average Pattern // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false smaa = Average[20](close) smab = Average[40](close) smac = Average[80](close) top = max(max(smaa, smab), smac) above = 0
20 more lines: the entry and exit rules.
Setup
Gold had no history beyond the standard run, so both runs used 30,000 bars.
| Bars available | 30,000 |
| Net, standard 200,000-bar run | 2,802.30 EUR |
| Net, long run | 2,802.30 EUR |
| Net on the older data alone | 0.00 EUR |
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 37 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 2.09 over 225 trades.
The best run had a maximum drawdown of 646 EUR at the tested position size, against a net result of 2,802 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.