Join waitlist
Strategies / Mean reversion / Three Bar Pullback Trend Buyer

Three Bar Pullback Trend Buyer

Buys when the close drops below the 3-bar SMA of lows while remaining above the 30-bar SMA of closes. Sells when the close rises above the 3-bar SMA of highs.

Mean reversionLong onlySwingS&P 500Daily
1.94Profit factor
3,731Net profit EUR
67.35%Win rate
637Trades
-392Max drawdown
5.86Avg trade

Best run of 11. S&P 500, Daily, spread 1, from run pf:2026-10-05-USA500-D.tsv:10.

Entry rules, long

  1. The close is above the 30-bar SMA of closes.

Exit rules

  1. No stop loss or profit target is set.

Test conditions

PeriodUp to 2026-10-05
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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best runDaily1.94 63767.353,731 EUR-392
Nikkei 225Daily1.86 53869.8956,488 USD-6,274
Nasdaq 100Daily1.64 49059.599,290 EUR-2,149
FTSE 100Daily1.55 50969.166,859 EUR-1,010
US Crude OilDaily1.51 44670.4014,595 EUR-3,139
EUR/USD30 minn/a 6,15763.5430,350 USD-15,251
EUR/USD1 hourn/a 5,18564.5720,104 USD-19,810
Dow JonesDailyn/a 54368.3217,342 EUR-5,985
Silver1 hourn/a 3,55860.7115,950 USD-8,434
Brent CrudeDailyn/a 21269.3410,265 EUR-3,227
Gold4 hoursn/a 1,03966.311,193 EUR-852

Charts

Results by run

Top 10 of 11 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

// ==============================================================
// Three Bar Pullback Trend Buyer
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

malow = Average[3](low)
mahigh = Average[3](high)
matrend = Average[30](close)

9 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
Longer historyRe-run on up to 1,000,000 barsS&P 500 · Daily · older data 59.21 EUR

S&P 500 had no history beyond the standard run, so both runs used 14,000 bars.

S&P 500 · Daily

Bars available14,000
Net, standard 200,000-bar run3,731.16 EUR
Net, long run3,790.37 EUR
Net on the older data alone59.21 EUR
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Three Bar Pullback Trend Buyer 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 11 market and timeframe combinations. The best run was S&P 500, Daily, with a profit factor of 1.94 over 637 trades.

How large was the drawdown?

The best run had a maximum drawdown of 392 EUR at the tested position size, against a net result of 3,731 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

SMA Trend RSI Dip Buying

Also a mean reversion strategy.

1.94 PF · 188 trades

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

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