It buys when the 5, 20, 50, 90, 140 and 200 period EMAs are in bullish order and either the 5 crosses over the 20 or the stack has just formed. It sells short on the mirror setup, and an opposite signal reverses it.
Best run of 11. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:4.
| Period | Up to 2026-10-10 |
| Instrument | USD/JPY, Daily |
| Spread | 1 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-10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.75 | 304 | 34.87 | 2,106,160 USD | -396,900 |
| USD/JPY | 1 hour | n/a | 3,321 | 29.33 | 422,120 USD | -229,050 |
| EUR/USD | Daily | n/a | 307 | 35.83 | 126,588 USD | -38,020 |
| Nikkei 225 | Daily | n/a | 258 | 35.27 | 42,993 USD | -12,867 |
| Silver | 4 hours | n/a | 725 | 28.69 | 17,399 USD | -15,448 |
| Nasdaq 100 | Daily | n/a | 283 | 34.63 | 13,446 EUR | -4,666 |
| Gold | Daily | n/a | 345 | 31.59 | 2,379 EUR | -809 |
| Gold | 1 hour | n/a | 2,790 | 29.14 | 2,156 EUR | -941 |
| Gold | 4 hours | n/a | 722 | 31.58 | 1,996 EUR | -904 |
| Gold | 30 min | n/a | 4,813 | 27.24 | 1,739 EUR | -1,502 |
| S&P 500 | Daily | n/a | 396 | 29.29 | 1,282 EUR | -1,108 |
Charts
Top 10 of 11 runs. The full list is in the table above.
The code
// ============================================================== // EMA Stack Crossover Bias // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ea = ExponentialAverage[5](close) eb = ExponentialAverage[20](close) ec = ExponentialAverage[50](close) ed = ExponentialAverage[90](close) ee = ExponentialAverage[140](close) ef = ExponentialAverage[200](close)
26 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 | 2,106,160.00 USD |
| Net, long run | 2,106,160.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 11 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.75 over 304 trades.
The best run had a maximum drawdown of 396,900 USD at the tested position size, against a net result of 2,106,160 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.