Buys when a reversal pattern on closing prices and a transform of the median price over 10 bars both point up, and sells short when both point down. Any open position is closed when the two signals disagree.
Best run of 5. USD/JPY, 4 hours, spread 1, from run sweeps:2026-10-12-USDJPY-4h-opt.tsv:7.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, 4 hours |
| 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 | 4 hours | n/a | 3,506 | 38.53 | 483,460 USD | -298,200 |
| USD/JPY | Daily | n/a | 1,359 | 38.63 | 1,446,900 USD | -434,910 |
| Brent Crude | Daily | n/a | 546 | 41.03 | 8,691 EUR | -5,912 |
| Gold | Daily | n/a | 1,405 | 37.37 | 1,795 EUR | -717 |
| Gold | 4 hours | n/a | 3,130 | 35.85 | 1,345 EUR | -1,161 |
Charts
The code
// ============================================================== // Reversal With Median Price Transform // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE posrev = 0 ONCE sincebad = 1000 ONCE postwo = 0 ONCE valone = 0 ONCE fish = 0 ll = lowest[15](low) hh = highest[15](high)
64 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 5 market and timeframe combinations. The best run by trade count was USD/JPY, 4 hours, with 3,506 trades.
The best run had a maximum drawdown of 298,200 USD at the tested position size, against a net result of 483,460 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.