Join waitlist
Strategies / Mean reversion / SMA 140 Envelope Reversion

SMA 140 Envelope Reversion

Buys when price closes back above a lower envelope set at 0.65 times the 140-period SMA, and sells when price closes back below an upper envelope at 1.45 times that SMA. The system only holds long positions.

Mean reversionLong onlySwingNikkei 225Daily
n/aProfit factor
59,388Net profit USD
100.00%Win rate
1Trades
-11,540Max drawdown
59,388Avg trade

Best run of 6. Nikkei 225, Daily, spread 10, from run sweeps:2026-10-12-NIKKEI-D-opt.tsv:36.

Entry rules, long

  1. The previous close is below the lower band (0.65 times the 140-period SMA).
  2. No long position is already open.
  3. Signals are only considered after bar 141.

Exit rules

  1. The previous close is above the upper band (1.45 times the 140-period SMA).
  2. No stop loss or profit target is set.

Test conditions

PeriodUp to 2026-10-12
InstrumentNikkei 225, Daily
Spread10 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
Nikkei 225Best runDailyn/a 1100.0059,388 USD-11,540
Nasdaq 100Dailyn/a 1100.0028,457 EUR-5,914
DAX 40Dailyn/a 1100.0022,319 EUR-5,511
SilverDailyn/a 1100.0017,785 USD-2,276
US Crude Oil15 minn/a 1100.007,615 EUR-7,128
US Crude Oil1 hourn/a 1100.007,133 EUR-7,083

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// SMA 140 Envelope Reversion
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

mdl = Average[140](close)
upr = mdl * 1.45
lwr = mdl * 0.65

10 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

SMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The best run has only 1 trades, which is a small sample to judge it on.

Questions

About this strategy

Can I run SMA 140 Envelope Reversion 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 6 market and timeframe combinations. The best run by trade count was Nikkei 225, Daily, with 1 trades.

How large was the drawdown?

The best run had a maximum drawdown of 11,540 USD at the tested position size, against a net result of 59,388 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

Rock Climber

Best run on the same market, Nikkei 225.

1.44 PF · 1,644 trades

ATR Band

Also a mean reversion strategy.

10.31 PF · 53 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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