The strategy buys when close crosses above a 15-period average while above a 59-period EMA and an 8-bar custom ADX is above 34. It sells short on the mirror cross and closes a position when close crosses the average the other way.
Best run of 4. Gold, Daily, spread 0.6, from run pf:2026-10-13-GOLD-D.tsv:8.
| Period | Up to 2026-10-13 |
| 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-13 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 3.01 | 145 | 39.31 | 1,729 EUR | -328 |
| Nikkei 225 | Daily | n/a | 85 | 27.06 | 7,305 USD | -5,975 |
| US Crude Oil | 4 hours | n/a | 344 | 30.81 | 5,694 EUR | -2,764 |
| Brent Crude | 4 hours | n/a | 274 | 29.56 | 2,969 EUR | -1,650 |
Charts
The code
// ============================================================== // SMA Cross With Custom ADX Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false gm = Average[15](close) sema = ExponentialAverage[59](close) sumtr = 0 sump = 0 summ = 0 FOR myI = 1 TO 8 DO trc = high[myI] - low[myI] trp = high[myI] - close[myI - 1] trl = low[myI] - close[myI - 1]
45 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 4 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 3.01 over 145 trades.
The best run had a maximum drawdown of 328 EUR at the tested position size, against a net result of 1,729 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.