Join today
Strategies / Mean reversion / Stochastic Extreme Cross

Stochastic Extreme Cross

For a long, Stochastic %K(14,3) must stay at or below 15 for 6 bars and then cross above its 5-bar average, with price at or above a 50000-period EMA. Shorts need %K at or above 87 for 4 bars. Each side has its own fixed point stop and target.

Mean reversionLong & shortIntradayGBP/USD15 min
n/aProfit factor
1,144Net profit USD
62.52%Win rate
691Trades
-637Max drawdown
1.66Avg trade

Best run of 8. GBP/USD, 15 min, spread 1.5, from run sweeps:2026-09-24-GBPUSD-15m-opt.tsv:2.

Entry rules, long

  1. Price is at or above the 50000-period EMA
  2. Members only
  3. %K crosses above its 5-bar average

Entry rules, short

  1. Price is below the 50000-period EMA
  2. Members only
  3. %K crosses below its 5-bar average

Exit rules

  1. Members only
  2. Short: stop loss 60 points, target 48 points

Test conditions

PeriodUp to 2026-09-24
InstrumentGBP/USD, 15 minutes
Spread1.5 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-24

Parameters

positionSize
Contracts per trade
1
stochPeriod
Stochastic %K length
14
stochSmooth
Stochastic smoothing
3
stochSignalPeriod
SMA of %K used as its signal line
5
trendPeriod
Very long EMA trend filter
50000
shortLookback
Bars %K must have stayed overbought
4
overboughtLevel
Overbought level for shorts
87
stopLossShort
Short stop in points
60
takeProfitShort
Short target in points
48
longLookback
Bars %K must have stayed oversold
6
oversoldLevel
Oversold level for longs
15
stopLossLong
Long stop in points
65
takeProfitLong
Long target in points
35

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GBP/USDBest run15 minn/a 69162.521,144 USD-637
Silver5 minn/a 38864.694,590 USD-4,101
Silver1 minn/a 54359.673,711 USD-3,210
EUR/USD1 minn/a 4459.092,211 USD-1,928
Gold10 minn/a 20074.502,057 EUR-600
Gold15 minn/a 19671.941,609 EUR-427
FTSE 10010 minn/a 56965.911,315 EUR-959
S&P 5003 minn/a 23966.11605 EUR-492

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-5K-3K3K5KSilver · 5 minSilver · 1 minEUR/USD · 1 minGold · 10 minGold · 15 minFTSE 100 · 10 minGBP/USD · 15 minS&P 500 · 3 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 Extreme Cross
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 15 minutes
// ============================================================

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

// --- Parameters ---
positionSize = 1          // contracts per trade
stochPeriod = 14          // Stochastic %K length
stochSmooth = 3           // Stochastic smoothing
stochSignalPeriod = 5     // SMA of %K used as its signal line
trendPeriod = 50000       // very long EMA trend filter, as published
shortLookback = 4         // bars %K must have stayed overbought
overboughtLevel = 87      // overbought level for shorts
stopLossShort = 60        // short stop, in points
takeProfitShort = 48      // short target, in points
longLookback = 6          // bars %K must have stayed oversold
oversoldLevel = 15        // oversold level for longs
stopLossLong = 65         // long stop, in points
takeProfitLong = 35       // long target, in points

// --- Indicators ---
stochK = Stochastic[stochPeriod, stochSmooth](close)
stochSignal = Average[stochSignalPeriod](stochK)
trendMA = ExponentialAverage[trendPeriod](close)
stochLowest = Lowest[shortLookback](stochK)
stochHighest = Highest[longLookback](stochK)

21 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Profit factor was not recorded. All results are sweep data.
  • Long stops (65 points) are wider than long targets (35 points), and the best run made only USD 1,144.10 over 691 trades.
  • The 50000-period EMA filter needs a very long history. On shorter data it barely changes, so the trend filter may do little.
  • EUR/USD 1 minute had only 44 trades, too few to judge.

Indicators used

StochasticEMA

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. The rewritten code has not been compile-checked, and the numbers are from the earlier version.

Which instruments were tested?

GBP/USD, Silver, EUR/USD, Gold, FTSE 100 and S&P 500 from 1 to 15 minutes. All rows were profitable, with Silver 5 minutes the largest at USD 4,590.

What risk does 1 contract carry?

The best run on GBP/USD 15 minutes had a max drawdown of USD 636.70. Silver 5 minutes went to USD 4,101, nearly equal to its profit.

Why intraday bars?

Stochastic extremes that last several bars show up often on short timeframes, which gives enough trades for the small fixed targets.

Related

Strategies like this one

Monday Dip Buy

Uses the same indicator.

n/a PF · 146 trades

SuperTrend CCI

Best run on the same market, GBP/USD.

1.72 PF · 561 trades

ATR Band

Also a mean reversion strategy.

10.31 PF · 53 trades

Short-term reversal systems need strict risk rules. See ours in the ProRealAlgos community.

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