Join waitlist
Strategies / Momentum / Leading Lagging Stochastic Swing

Leading Lagging Stochastic Swing

The system buys when the slow 97-bar stochastic is above 50 and the smoothed 5-bar stochastic is below 30 and rising, and shorts on the mirror setup. Positions close at a 1.2 ratio against the second most recent signal close.

MomentumLong & shortSwingSilver1 hour
3.69Profit factor
572,728Net profit USD
34.96%Win rate
1,064Trades
-22,492Max drawdown
538Avg trade

Best run of 21. Silver, 1 hour, spread 2, from run pf:2026-10-12-SILVER-1h.tsv:2.

Entry rules, long

  1. The slow stochastic, based on the 97-bar high and low range, is above 50.
  2. The 2-period EMA of the 5-bar stochastic is rising compared with the prior bar.

Entry rules, short

  1. The slow stochastic is below 50.
  2. The 2-period EMA of the 5-bar stochastic is falling compared with the prior bar.

Exit rules

  1. A short closes when the close is at or below the second most recent sell signal close divided by 1.2.

Test conditions

PeriodUp to 2026-10-12
InstrumentSilver, 1 hour
Spread2 points
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-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run1 hour3.69 1,06434.96572,728 USD-22,492
Gold10 min1.32 1,73337.104,301 EUR-627
Silver15 min1.30 1,73335.7256,574 USD-12,121
USD/JPYDailyn/a 11837.291,791,760 USD-1,042,160
USD/JPY15 minn/a 1,64937.60721,550 USD-223,110
USD/JPY10 minn/a 1,67538.27578,970 USD-243,830
USD/JPY5 minn/a 1,73837.05352,410 USD-168,320
EUR/USDDailyn/a 11540.87133,087 USD-40,571
Silver10 minn/a 1,77734.4431,103 USD-19,347
SilverDailyn/a 17040.5923,109 USD-18,417
Nasdaq 1004 hoursn/a 26040.7718,241 EUR-5,233
DAX 40Dailyn/a 17440.8017,053 EUR-7,265
Nikkei 2252 minn/a 1,74035.0013,904 USD-11,302
Brent Crude4 hoursn/a 16443.2913,034 EUR-5,162
DAX 4015 minn/a 1,72136.786,415 EUR-6,005
US Crude Oil5 minn/a 1,70336.934,500 EUR-3,131
S&P 5004 hoursn/a 27535.273,128 EUR-1,434
GoldDailyn/a 16639.162,380 EUR-871
Gold4 hoursn/a 28639.512,336 EUR-989
Gold30 minn/a 1,70436.441,909 EUR-1,063
Gold1 hourn/a 1,04535.601,333 EUR-1,262

Charts

Results by run

Top 10 of 21 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Leading Lagging Stochastic Swing
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE rawfast = 50
ONCE rawslow = 50
ONCE buylast = 0
ONCE buyprev = 0
ONCE selllast = 0
ONCE sellprev = 0

hhf = highest[5](high)
llf = lowest[5](low)

39 more lines: the entry and exit rules.

Setup

How to load it

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

Indicators used

StochasticEMA
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Leading Lagging Stochastic Swing in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 21 market and timeframe combinations. The best run was Silver, 1 hour, with a profit factor of 3.69 over 1,064 trades.

How large was the drawdown?

The best run had a maximum drawdown of 22,492 USD at the tested position size, against a net result of 572,728 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

KDJ J Line Trend Long

Also a momentum strategy.

3.77 PF · 3,892 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

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