The strategy buys when the 8-period, 14-period and 50-period EMAs are stacked upward and the smoothed Stochastic RSI line crosses above its signal line. It sells short on the mirror setup, with a stop 3.0 times ATR(14) and a target 2.0 times ATR(14).
Best run of 2. Gold, Daily, spread 0.6, from run sweeps:2026-10-04-GOLD-D-opt.tsv:133.
| Period | Up to 2026-10-04 |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | n/a | 589 | 62.48 | 1,753 EUR | -850 |
| US Crude Oil | Daily | n/a | 505 | 64.16 | 16,263 EUR | -5,949 |
Charts
The code
// ============================================================== // EMA Stack Stochastic RSI Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE stochraw = 50 emafast = ExponentialAverage[8](close) emamid = ExponentialAverage[14](close) emaslow = ExponentialAverage[50](close) myRsi = RSI[14](close) rsihi = highest[14](myRsi) rsilo = lowest[14](myRsi)
29 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 2 market and timeframe combinations. The best run by trade count was Gold, Daily, with 589 trades.
The best run had a maximum drawdown of 850 EUR at the tested position size, against a net result of 1,753 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.