Join today
Strategies / Mean reversion / Stochastic Reversal

Stochastic Reversal: Oversold and Overbought Crosses Tested

Longs trigger when Stochastic %K (14,3) crosses above %D below 20, and shorts when it crosses below %D above 80. Positions close when %K reaches 50 or at a 1% stop. There is no profit target and only one position at a time.

Mean reversionLong & shortIntradayNasdaq 10030 min
n/aProfit factor
-30,058Net profit EUR
52.04%Win rate
7,963Trades
-32,678Max drawdown
-3.77Avg trade

Best run of 16. Nasdaq 100, 30 min, spread 3, from run sweeps:2026-09-07-NAS100-30m-opt.tsv:12.

Entry rules, long

  1. Members only
  2. %K is below 20
  3. No open position

Entry rules, short

  1. Members only
  2. %K is above 80
  3. No open position

Exit rules

  1. Stop loss 1% from entry
  2. Members only
  3. Cover a short when %K falls below 50

Test conditions

PeriodUp to 2026-09-07
InstrumentNasdaq 100, 30 minutes
Spread3 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-07

Parameters

positionSize
Contracts per trade
1
stochPeriod
Stochastic lookback
14
stochSmooth
%K smoothing
3
stochDSmooth
%D smoothing
3
oversoldLevel
Longs only when %K is below this
20
overboughtLevel
Shorts only when %K is above this
80
stochExitLevel
Exit once %K reaches this level
50
stopLossPct
Protective stop, percent of entry price
1

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run30 minn/a 7,96352.04-30,058 EUR-32,678
S&P 5001 hourn/a 5,02256.37-3,838 EUR-5,052
Gold5 minn/a 7,19256.58-4,692 EUR-4,776
Gold30 minn/a 7,11857.15-5,427 EUR-5,828
Gold15 minn/a 7,08655.09-5,453 EUR-5,516
Gold1 hourn/a 4,81357.24-5,458 EUR-5,514
S&P 5005 minn/a 7,19652.95-8,110 EUR-8,192
S&P 50030 minn/a 7,70753.95-8,194 EUR-8,681
S&P 50015 minn/a 7,45656.88-8,320 EUR-8,593
Nasdaq 1001 hourn/a 5,19953.16-17,295 EUR-20,420
DAX 405 minn/a 7,34057.98-21,313 EUR-21,799
DAX 4015 minn/a 7,41159.67-22,602 EUR-24,371
Nasdaq 1005 minn/a 7,32257.74-24,857 EUR-26,716
DAX 401 hourn/a 4,87355.92-28,474 EUR-29,471
DAX 4030 minn/a 7,62457.88-28,719 EUR-32,246
Nasdaq 10015 minn/a 7,58957.29-31,697 EUR-33,705

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-50K-25KS&P 500 · 1 hourGold · 5 minGold · 30 minGold · 15 minGold · 1 hourS&P 500 · 5 minS&P 500 · 30 minS&P 500 · 15 minNasdaq 100 · 1 hourDAX 40 · 5 minDAX 40 · 15 minNasdaq 100 · 5 minDAX 40 · 1 hourDAX 40 · 30 minNasdaq 100 · 30 minNasdaq 100 · 15 min

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 Reversal
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 30 minutes
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1       // contracts per trade
stochPeriod = 14       // stochastic lookback
stochSmooth = 3        // %K smoothing
stochDSmooth = 3       // %D smoothing
oversoldLevel = 20     // longs only when %K is below this
overboughtLevel = 80   // shorts only when %K is above this
stochExitLevel = 50    // exit once %K reaches the middle
stopLossPct = 1        // protective stop, percent of entry price

// --- Indicators ---
stochK = Stochastic[stochPeriod, stochSmooth](close)
stochD = StochasticD[stochPeriod, stochSmooth, stochDSmooth](close)

26 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Every market in the table lost money. The best listed run on Nasdaq 100 30 minutes ended at EUR -30,058.1.
  • The 52.04% win rate did not cover the losses, and the average trade was EUR -3.77.
  • Drawdowns were large, EUR 32,677.8 on the Nasdaq 100 run and EUR 32,246.1 on DAX 40 30 minutes.
  • Profit factor was not recorded because only sweep data exists.

Indicators used

Stochastic

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

Should I run this in ProOrder?

It can technically run in ProOrder, but every backtest lost money. Treat it as a reference for what does not work, not a live system.

Which markets were tested?

Nasdaq 100, S&P 500, Gold and DAX 40. The smallest loss was S&P 500 1 hour at EUR -3,837.55, and Nasdaq 100 15 minutes lost EUR -31,697.2.

What drawdown came with 1 contract?

The Nasdaq 100 30 minute run had a EUR 32,677.8 drawdown with 1 contract.

Would a different timeframe help?

Runs from 5 minutes to 1 hour all lost money, so the timeframe was not the problem.

Related

Strategies like this one

Stochastic Extreme Reversal

Uses the same indicator.

3.94 PF · 974 trades

Negated Hammer

Best run on the same market, Nasdaq 100.

3.20 PF · 372 trades

Monday Dip Buy

Also a mean reversion strategy.

n/a PF · 146 trades

Find out which oscillator systems did hold up. Join the ProRealAlgos waitlist.

Copy trading on US indices is available to ProRealAlgos members as spots open.

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