Join waitlist
Strategies / Trend / Reversal Pattern With Detrended Synthetic Price

Reversal Pattern With Detrended Synthetic Price

The system buys when a stochastic-based close reversal agrees with a positive difference between the 14-period and 28-period exponential averages of the median price, and sells short on the negative mirror. Positions close when the states disagree.

TrendLong & shortSwingUSD/JPYDaily
1.79Profit factor
2,862,200Net profit USD
37.26%Win rate
263Trades
-514,090Max drawdown
10,883Avg trade

Best run of 16. USD/JPY, Daily, spread 1, from run pf:2026-10-13-USDJPY-D.tsv:2.

Entry rules, long

  1. The close is above the prior close, and the prior close was below the close 2 bars earlier.
  2. The Stochastic %K (14 periods) is below its 3-period SMA and above 50 on the same bar.
  3. When both states are bullish and no long is open, the system buys 1 contract at market.

Entry rules, short

  1. The close is below the prior close, and the prior close was above the close 2 bars earlier.
  2. The Stochastic %K (14 periods) is above its 3-period SMA and below 50 on the same bar.
  3. When both states are bearish and no short is open, the system sells 1 contract short at market.

Exit rules

  1. When they no longer agree, an open short is bought back at market.

Test conditions

PeriodUp to 2026-10-13
InstrumentUSD/JPY, Daily
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.79 26337.262,862,200 USD-514,090
USD/JPY30 minn/a 4,06332.32524,490 USD-240,990
USD/JPY10 minn/a 4,23230.08348,440 USD-201,280
USD/JPY1 hourn/a 2,85833.45317,900 USD-291,380
EUR/USDDailyn/a 26434.4769,124 USD-65,851
Nikkei 225Dailyn/a 23234.9134,468 USD-18,466
Brent CrudeDailyn/a 10435.5814,684 EUR-9,134
US Crude OilDailyn/a 22835.5311,719 EUR-8,837
DAX 4030 minn/a 4,16732.4910,084 EUR-6,987
US Crude Oil1 hourn/a 1,86534.265,831 EUR-5,720
GBP/USD1 hourn/a 3,59433.754,685 USD-4,639
GoldDailyn/a 27335.902,200 EUR-1,061
Gold1 hourn/a 2,49432.281,949 EUR-1,085
Gold4 hoursn/a 63533.231,838 EUR-780
S&P 500Dailyn/a 30831.171,614 EUR-1,288
Gold30 minn/a 4,14531.311,485 EUR-989

Charts

Results by run

Top 10 of 16 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Reversal Pattern With Detrended Synthetic Price
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE kraw = 50
ONCE posrev = 0
ONCE posb = 0

hh = highest[14](high)
ll = lowest[14](low)

40 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

EMAStochastic
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Reversal Pattern With Detrended Synthetic Price in ProOrder?

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.

Which markets was it tested on?

It was tested on 16 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.79 over 263 trades.

How large was the drawdown?

The best run had a maximum drawdown of 514,090 USD at the tested position size, against a net result of 2,862,200 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

EMA Crossover With Trend Filter (long only)

Also a trend strategy.

1.79 PF · 382 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs