Join today
Strategies / Mean reversion / Stochastic Extreme Reversal

Stochastic Extreme Reversal: stochastic crosses with a patient RSI exit

Longs enter on a Stochastic %K(18,2) cross above its 6 period %D, while shorts need %K to fall back from above 90 and cross down twice. Exits wait for RSI(2) to touch an extreme several times before closing. No stop or target is used.

Mean reversionLong & shortSwingSilver1 hour
3.94Profit factor
571,597Net profit USD
56.98%Win rate
974Trades
-568,775Max drawdown
587Avg trade

Best run of 14. Silver, 1 hour, spread 2, from run pf:2026-09-16-SILVER-1h.tsv:1.

Entry rules, long

  1. No position is open and no short setup is pending
  2. At least two bars since the last setup or entry
  3. Members only

Entry rules, short

  1. A short setup is armed: %K was above 90 in the last 2 bars and crossed below %D
  2. No position is open and at least two bars since the setup
  3. Members only

Exit rules

  1. Members only
  2. Short: the mirror with RSI(2) and level 5
  3. No stop loss or target

Test conditions

PeriodUp to 2026-09-16
InstrumentSilver, 1 hour
Spread2 points
Contracts1
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-09-16

Parameters

positionSize
Contracts per trade
1
stochPeriod
Stochastic lookback
18
stochSmooth
%K smoothing
2
stochDPeriod
%D average of %K
6
overboughtLevel
Extreme high for a short setup
90
oversoldLevel
Extreme low for a long setup
10
consolidationPeriod
Bars checked for the extreme reading
2
rsiPeriod
RSI length for exits
2
rsiUpperLevel
RSI peak level for long exits
95
rsiLowerLevel
RSI trough level for short exits
5
rsiExitCount
RSI peaks needed before exit
4
rsiPeakLookback
Bars used to measure each RSI peak
8
rsiBaseline
Starting value for the last RSI peak
50

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run1 hour3.94 97456.98571,597 USD-568,775
Nikkei 2254 hours1.70 23164.5052,240 USD-13,131
S&P 500Daily1.65 13559.263,714 EUR-1,595
Nasdaq 1001 hour1.18 1,06057.1714,231 EUR-6,458
Dow Jones5 min1.16 1,60858.6418,565 EUR-7,440
Nikkei 22515 min1.11 1,66958.2428,398 USD-23,317
Nikkei 22530 min1.10 1,66855.2226,850 USD-24,064
Dow Jones10 min1.10 1,62758.4517,249 EUR-9,746
S&P 50030 min1.10 1,54158.342,486 EUR-1,195
Silver3 min1.09 1,56256.5920,029 USD-16,252
Dow Jones3 min1.08 1,58858.568,452 EUR-6,349
DAX 401 hour1.07 97757.526,429 EUR-5,527
Nikkei 225Dailyn/a 9565.2642,661 USD-19,731
FTSE 100Dailyn/a 9958.594,665 EUR-4,527

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.01.32.53.85.01.0 = break-evenSilver · 1 hour3.94Nikkei 225 · 4 hours1.70S&P 500 · Daily1.65Nasdaq 100 · 1 hour1.18Dow Jones · 5 min1.16Nikkei 225 · 15 min1.11Nikkei 225 · 30 min1.10Dow Jones · 10 min1.10S&P 500 · 30 min1.10Silver · 3 min1.09Dow Jones · 3 min1.08DAX 40 · 1 hour1.07

Net profit against max drawdown

Net profitMax drawdown
0-1.0M-500K500K1.0MSilver · 1 hourNikkei 225 · 4 hoursNikkei 225 · DailyNikkei 225 · 15 minNikkei 225 · 30 minSilver · 3 minDow Jones · 5 minDow Jones · 10 minNasdaq 100 · 1 hourDow Jones · 3 minDAX 40 · 1 hourFTSE 100 · DailyS&P 500 · DailyS&P 500 · 30 min

Longer history

Re-run on up to 1,000,000 bars

Silver 3 minutes had all 1,000,000 bars, and the long run lost USD 23,707 where the standard run made USD 20,029, meaning the older data alone lost USD 43,736.

Silver · 3 min

Bars available1,000,000
Net, standard 200,000-bar run20,029.00 USD
Net, long run-23,707.00 USD
Net on the older data alone-43,736.00 USD

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Stochastic Extreme Reversal
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 1 hour
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 1000

// --- Parameters ---
positionSize = 1           // contracts per trade
stochPeriod = 18           // stochastic lookback
stochSmooth = 2            // %K smoothing
stochDPeriod = 6           // %D average of %K
overboughtLevel = 90       // stochastic must have been above this for a short setup
oversoldLevel = 10         // stochastic must have been below this for a long setup
consolidationPeriod = 2    // bars checked for the extreme reading
rsiPeriod = 2              // fast RSI used for exits
rsiUpperLevel = 95         // RSI peak level that counts for longs
rsiLowerLevel = 5          // RSI trough level that counts for shorts
rsiExitCount = 4           // RSI peaks needed before the exit is allowed
rsiPeakLookback = 8        // bars used to measure each RSI peak
rsiBaseline = 50           // starting value for the last RSI peak

ONCE setupState = 0        // -1 long setup, 1 short setup, 0 none
ONCE barsSinceSetup = 0
ONCE rsiPeakCount = 0
ONCE lowerPeakCount = 0
ONCE lastRsiPeak = 0

// --- Indicators ---
stochK = Stochastic[stochPeriod, stochSmooth](close)
stochD = Average[stochDPeriod](stochK)
rsiValue = RSI[rsiPeriod](close)

56 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • On Silver 1 hour max drawdown was USD 568,775, almost equal to the USD 571,596.5 net profit despite a profit factor of 3.94.
  • There is no stop loss. The RSI(2) exit can take many bars to trigger while the trade moves against you.
  • A known quirk is kept from the original: a long can fire on any %K over %D cross, not only after an oversold setup.
  • Outside the best run most profit factors were modest, between 1.07 and 1.7.

Indicators used

StochasticRSI

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can it run live in ProOrder?

Yes, it uses Stochastic and RSI only, with one position at a time. Compile check the rewritten code first.

Which markets were tested?

Silver, Nikkei 225, S&P 500, Nasdaq 100, Dow Jones, DAX 40 and FTSE 100. Every listed run was profitable, with DAX 40 1 hour the weakest at a profit factor of 1.07.

How much drawdown at 1 contract?

The best run hit USD 568,775 drawdown on Silver 1 hour. On S&P 500 Daily it was EUR 1,594.53, so size by instrument.

Why 1 hour bars on Silver?

That run gave the highest profit factor on the page, 3.94. The RSI(2) exit needs several swings, which hourly bars provide in a few days.

Related

Strategies like this one

RSI 3 Oversold Long

Uses the same indicator.

2.12 PF · 255 trades

Percent B Bollinger Trend

Best run on the same market, Silver.

5.43 PF · 3,202 trades

Turnaround Tuesday

A similar profit factor.

3.80 PF · 39 trades

Mean reversion traders share their tests inside ProRealAlgos. Join the waitlist.

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