A 5 period SMA crossing the 10 period SMA starts the signal, but only if Stochastic %K is rising fast and RSI(14) agrees with the direction. Longs also need the 10 bar average of %K below 45, and shorts need it above 55. Trades aim for 50 points with a 1000 point stop.
Best run of 1. EUR/USD, 4 hours, spread 1, from run pf:2026-09-16-EURUSD-4h.tsv:1.
| Period | Up to 2026-09-16 |
| Instrument | EUR/USD, 4 hours |
| Spread | 1 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-16 |
| positionSize Contracts per trade | 1 |
| fastPeriod Fast SMA length | 5 |
| slowPeriod Slow SMA length | 10 |
| stochPeriod Stochastic %K length | 14 |
| stochSmooth Stochastic smoothing | 3 |
| stochSignalPeriod SMA of %K used as its signal line | 5 |
| stochTrendPeriod Slower SMA of %K for the stretch filter | 10 |
| stochMomentum How far %K must lead its signal line | 10 |
| stochLongMax Longs need the slow %K average below this | 45 |
| stochShortMin Shorts need the slow %K average above this | 55 |
| rsiPeriod RSI length | 14 |
| rsiLongLevel Longs need RSI above this | 45 |
| rsiShortLevel Shorts need RSI below this | 55 |
| takeProfitPoints Profit target in points | 50 |
| stopLossPoints Protective stop in points | 1000 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 4 hours | 1.25 | 1,290 | 73.26 | 91,809 USD | -25,113 |
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.
// ============================================================ // RSI Stochastic MA Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false DEFPARAM PreloadBars = 1000 // --- Parameters --- positionSize = 1 // contracts per trade fastPeriod = 5 // fast SMA slowPeriod = 10 // slow SMA stochPeriod = 14 // Stochastic %K length stochSmooth = 3 // Stochastic smoothing stochSignalPeriod = 5 // SMA of %K used as its signal line stochTrendPeriod = 10 // slower SMA of %K for the not-stretched filter stochMomentum = 10 // %K must lead its signal line by this much stochLongMax = 45 // longs need the slow %K average below this stochShortMin = 55 // shorts need the slow %K average above this rsiPeriod = 14 // RSI length rsiLongLevel = 45 // longs need RSI above this rsiShortLevel = 55 // shorts need RSI below this takeProfitPoints = 50 // profit target in points stopLossPoints = 1000 // protective stop in points // --- Indicators --- fastMA = Average[fastPeriod](close) slowMA = Average[slowPeriod](close) stochK = Stochastic[stochPeriod, stochSmooth](close) stochSignal = Average[stochSignalPeriod](stochK) stochTrend = Average[stochTrendPeriod](stochK) rsiValue = RSI[rsiPeriod](close)
20 more lines: the entry and exit rules.
Read this first
Questions
Yes. The target, stop and reversal on opposite signals are all coded.
Only EUR/USD 4 hours: 91,809 USD over 1290 trades with a 25,113 USD drawdown.
A single stopped trade can lose 1000 points while a winner makes 50. The worst drawdown in the test was 25,113 USD.
It was the only timeframe tested. The filters need several days of price action to line up, which fits 4 hour bars.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.