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.
Best run of 8. GBP/USD, 15 min, spread 1.5, from run sweeps:2026-09-24-GBPUSD-15m-opt.tsv:2.
| Period | Up to 2026-09-24 |
| Instrument | GBP/USD, 15 minutes |
| Spread | 1.5 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-24 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GBP/USDBest run | 15 min | n/a | 691 | 62.52 | 1,144 USD | -637 |
| Silver | 5 min | n/a | 388 | 64.69 | 4,590 USD | -4,101 |
| Silver | 1 min | n/a | 543 | 59.67 | 3,711 USD | -3,210 |
| EUR/USD | 1 min | n/a | 44 | 59.09 | 2,211 USD | -1,928 |
| Gold | 10 min | n/a | 200 | 74.50 | 2,057 EUR | -600 |
| Gold | 15 min | n/a | 196 | 71.94 | 1,609 EUR | -427 |
| FTSE 100 | 10 min | n/a | 569 | 65.91 | 1,315 EUR | -959 |
| S&P 500 | 3 min | n/a | 239 | 66.11 | 605 EUR | -492 |
Charts
The code
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
Questions
Yes. The rewritten code has not been compile-checked, and the numbers are from the earlier version.
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.
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.
Stochastic extremes that last several bars show up often on short timeframes, which gives enough trades for the small fixed targets.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.