The system buys when EMA(20) is above EMA(50) and the close crosses above EMA(20), and sells short on the mirror condition. Stops and targets sit 2 and 4 times ATR(14) from the entry, and an opposite signal reverses the trade.
Best run of 4. Silver, 4 hours, spread 2, from run pf:2026-10-05-SILVER-4h.tsv:4.
| Period | Up to 2026-10-05 |
| Instrument | Silver, 4 hours |
| Spread | 2 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| SilverBest run | 4 hours | 3.36 | 809 | 31.03 | 310,939 USD | -18,495 |
| USD/JPY | Daily | 1.47 | 806 | 40.45 | 49,710 USD | -7,670 |
| Nikkei 225 | 4 hours | n/a | 658 | 32.22 | 19,245 USD | -16,268 |
| US Crude Oil | 4 hours | n/a | 602 | 35.05 | 10,536 EUR | -4,788 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // EMA Crossover With ATR Brackets // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false fast = ExponentialAverage[20](close) slow = ExponentialAverage[50](close) myAtr = AverageTrueRange[14](close)
28 more lines: the entry and exit rules.
Setup
USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.
| Bars available | 12,000 |
| Net, standard 200,000-bar run | 49,710.00 USD |
| Net, long run | 49,710.00 USD |
| Net on the older data alone | 0.00 USD |
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 Silver, 4 hours, with a profit factor of 3.36 over 809 trades.
The best run had a maximum drawdown of 18,495 USD at the tested position size, against a net result of 310,938 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.