Join waitlist
Strategies / Pattern / Stochastic Reversal With Average Spread

Stochastic Reversal With Average Spread

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.

PatternLong & shortSwingUSD/JPYDaily
1.81Profit factor
2,793,930Net profit USD
39.41%Win rate
236Trades
-397,900Max drawdown
11,839Avg trade

Best run of 9. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:15.

Entry rules, long

  1. The RAVI, the percent spread between the 7-bar and 65-bar averages of close, is above 0.14.
  2. Both states must be +1 to buy 1 contract at market.

Entry rules, short

  1. The RAVI, the percent spread between the 7-bar and 65-bar averages of close, is below 0.14.
  2. Both states must be -1 to sell 1 contract short at market.

Exit rules

  1. No stop loss or profit target is set.

Test conditions

PeriodUp to 2026-10-12
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.81 23639.412,793,930 USD-397,900
EUR/USDDailyn/a 24934.1468,955 USD-64,123
Nikkei 225Dailyn/a 21334.7439,523 USD-19,680
Brent CrudeDailyn/a 10036.0015,506 EUR-6,614
US Crude OilDailyn/a 21036.1912,097 EUR-8,203
Gold30 minn/a 3,56632.532,035 EUR-811
GoldDailyn/a 23934.311,793 EUR-1,072
Gold4 hoursn/a 58332.761,371 EUR-902
Gold1 hourn/a 2,24732.041,351 EUR-1,014

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

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

StochasticSMA
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Stochastic Reversal With Average Spread 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 9 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.81 over 236 trades.

How large was the drawdown?

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.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

Fair Value Gap Break of Structure

Also a pattern strategy.

1.81 PF · 2,073 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