It goes long after two consecutive higher closes while stochastic %K is above 50 and below its 3-bar average, and shorts the mirror setup. Longs also need the spread between the 7-bar and 65-bar averages above 0.14 percent, and shorts need it below 0.14 percent.
Best run of 9. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:15.
| Period | Up to 2026-10-12 |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.81 | 236 | 39.41 | 2,793,930 USD | -397,900 |
| EUR/USD | Daily | n/a | 249 | 34.14 | 68,955 USD | -64,123 |
| Nikkei 225 | Daily | n/a | 213 | 34.74 | 39,523 USD | -19,680 |
| Brent Crude | Daily | n/a | 100 | 36.00 | 15,506 EUR | -6,614 |
| US Crude Oil | Daily | n/a | 210 | 36.19 | 12,097 EUR | -8,203 |
| Gold | 30 min | n/a | 3,566 | 32.53 | 2,035 EUR | -811 |
| Gold | Daily | n/a | 239 | 34.31 | 1,793 EUR | -1,072 |
| Gold | 4 hours | n/a | 583 | 32.76 | 1,371 EUR | -902 |
| Gold | 1 hour | n/a | 2,247 | 32.04 | 1,351 EUR | -1,014 |
Charts
The code
// ============================================================== // Stochastic Reversal With Average Spread // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE posrev = 0 ONCE sincebad = 1000 ONCE postwo = 0 ll = lowest[14](low) hh = highest[14](high)
51 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 9 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.81 over 236 trades.
The best run had a maximum drawdown of 397,900 USD at the tested position size, against a net result of 2,793,930 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.