Join waitlist
Strategies / Breakout / Order Block Retest Trend Filter

Order Block Retest Trend Filter

The system marks the last opposite candle before a break of the prior 20-bar high or low as an order block. It buys when price retests a bullish block, closes above its midpoint and momentum filters agree, and sells short on the mirror setup.

BreakoutLong & shortSwingNasdaq 1004 hours
n/aProfit factor
4,914Net profit EUR
34.79%Win rate
549Trades
-2,634Max drawdown
8.95Avg trade

Best run of 6. Nasdaq 100, 4 hours, spread 3, from run sweeps:2026-10-03-NAS100-4h-opt.tsv:20.

Entry rules, long

  1. The close is above the midpoint of the bullish order block.
  2. The close is above EMA(50), EMA(50) is above EMA(200), and RSI(14) is above 50.
  3. Stochastic %K(14,3) is above %D(3) and below 80.
  4. The signal triggers only on the first bar where all conditions are met.

Entry rules, short

  1. The close is below the midpoint of the bearish order block.
  2. The close is below EMA(50), EMA(50) is below EMA(200), and RSI(14) is below 50.
  3. Stochastic %K(14,3) is below %D(3) and above 20.
  4. The signal triggers only on the first bar where all conditions are met.

Exit rules

  1. The target is 2 times the risk measured from the fill price.
  2. An opposite signal closes the trade and reverses it.

Test conditions

PeriodUp to 2026-10-03
InstrumentNasdaq 100, 4 hours
Spread3 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-03

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run4 hoursn/a 54934.794,914 EUR-2,634
USD/JPYDailyn/a 28033.9311,080 USD-4,660
Dow JonesDailyn/a 25433.465,081 EUR-3,639
Brent Crude4 hoursn/a 26735.584,056 EUR-2,964
S&P 500Dailyn/a 29031.381,142 EUR-623
Gold4 hoursn/a 51036.86887 EUR-412

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Order Block Retest Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Breakout
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE bearhi = 0
ONCE bearlo = 0
ONCE bullhi = 0
ONCE bulllo = 0
ONCE bullobhi = 0
ONCE bulloblo = 0
ONCE bearobhi = 0
ONCE bearoblo = 0
ONCE side = 0
ONCE stochraw = 50
ONCE buysig = 0
ONCE sellsig = 0

emafast = ExponentialAverage[50](close)
emaslow = ExponentialAverage[200](close)
rsival = RSI[14](close)
atrval = AverageTrueRange[14](close)

hh = highest[14](high)
ll = lowest[14](low)

79 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

EMARSIATRStochastic
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 2,634 EUR is large next to the net profit of 4,914 EUR.

Questions

About this strategy

Can I run Order Block Retest Trend Filter 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 Nasdaq 100, 4 hours, with 549 trades.

How large was the drawdown?

The best run had a maximum drawdown of 2,634 EUR at the tested position size, against a net result of 4,914 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

Big Candle Breakout

Also a breakout strategy.

n/a PF · 4,636 trades

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

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