The strategy buys when the bar trades above the 20-period EMA, the stochastic %K is above its %D line, and the EMA is rising over 20 bars. It sells short on the mirror setup, and exits on a close back through the 20-period EMA.
Best run of 4. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:12.
| 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.50 | 690 | 31.45 | 2,752,260 USD | -461,570 |
| EUR/USD | Daily | n/a | 658 | 33.13 | 101,897 USD | -53,403 |
| GBP/USD | Daily | n/a | 687 | 33.77 | 17,895 USD | -6,899 |
| Nikkei 225 | Daily | n/a | 611 | 31.10 | 17,503 USD | -16,545 |
Charts
The code
// ============================================================== // EMA Stochastic Trend Follow // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE myK = 50 hh = highest[14](high) ll = lowest[14](low)
23 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,752,260.00 USD |
| Net, long run | 2,752,250.00 USD |
| Net on the older data alone | -10.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 USD/JPY, Daily, with a profit factor of 1.50 over 690 trades.
The best run had a maximum drawdown of 461,570 USD at the tested position size, against a net result of 2,752,260 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.