Join waitlist
Strategies / Mean reversion / Uptrend Pullback With Time Exit

Uptrend Pullback With Time Exit

The strategy buys after a pullback while the 40-period EMA is above the 80-period EMA. It sells when that trend turns down, the close rises above its 20-bar average, the close falls below 0.85 times the entry close, or 20 bars pass.

Mean reversionLong onlySwingS&P 500Daily
n/aProfit factor
1,297Net profit EUR
46.11%Win rate
3,023Trades
-1,265Max drawdown
0.43Avg trade

Best run of 4. S&P 500, Daily, spread 1, from run sweeps:2026-10-04-USA500-D-opt.tsv:16.

Entry rules, long

  1. The 40-period EMA is above the 80-period EMA
  2. No long position is currently open

Exit rules

  1. The close is above the 20-bar simple moving average
  2. The close falls below 0.85 times the entry signal close
  3. The position has been held for 20 bars, counting the entry bar as 1

Test conditions

PeriodUp to 2026-10-04
InstrumentS&P 500, Daily
Spread1 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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best runDailyn/a 3,02346.111,297 EUR-1,265
EUR/USDDailyn/a 45870.7465,835 USD-18,485
Dow JonesDailyn/a 2,81654.3016,484 EUR-5,786
Nasdaq 100Dailyn/a 2,28447.508,999 EUR-3,865

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Uptrend Pullback With Time Exit
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE held = 0
ONCE myStop = 0

emafast = ExponentialAverage[40](close)
emaslow = ExponentialAverage[80](close)

27 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

EMASMAStandard Deviation
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 1,265 EUR is large next to the net profit of 1,297 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Uptrend Pullback With Time Exit 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 4 market and timeframe combinations. The best run by trade count was S&P 500, Daily, with 3,023 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,265 EUR at the tested position size, against a net result of 1,297 EUR.

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

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

ATR Band

Also a mean reversion strategy.

10.31 PF · 53 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

Copy trading on US indices is available to ProRealAlgos members as spots open.

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