Join waitlist
Strategies / Mean reversion / Basis Cross Reversion With Trend Filter

Basis Cross Reversion With Trend Filter

The strategy buys when close crosses above the 20-bar SMA while above the 89-bar and 200-bar EMAs, after recent closes reached the lower bands. It sells short on the mirror setup.

Mean reversionLong & shortSwingUS Crude Oil1 hour
n/aProfit factor
1,816Net profit EUR
69.20%Win rate
591Trades
-1,285Max drawdown
3.07Avg trade

Best run of 3. US Crude Oil, 1 hour, spread 3, from run sweeps:2026-10-07-CRUDE-1h-opt.tsv:4.

Entry rules, long

  1. The lowest close of the last 10 bars is at or below the lower 2 standard deviation band.
  2. The lowest close of the last 5 bars is at or below the lower 1 standard deviation band.

Entry rules, short

  1. The highest close of the last 10 bars is at or above the upper 2 standard deviation band.
  2. The highest close of the last 5 bars is at or above the upper 1 standard deviation band.

Exit rules

  1. The stop is the lower 2 standard deviation band at the signal bar, applied as a fixed distance from the fill.
  2. An opposite signal closes the trade and reverses it.

Test conditions

PeriodUp to 2026-10-07
InstrumentUS Crude Oil, 1 hour
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-07

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
US Crude OilBest run1 hourn/a 59169.201,816 EUR-1,285
Nasdaq 100Dailyn/a 4461.362,218 EUR-1,056
DAX 404 hoursn/a 13863.771,834 EUR-847

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Basis Cross Reversion With Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

emaa = ExponentialAverage[89](close)
emab = ExponentialAverage[200](close)
basis = Average[20](close)
dev = STD[20](close)
upone = basis + dev
loone = basis - dev
uptwo = basis + 2 * dev
lotwo = basis - 2 * dev

30 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

SMAEMABollinger BandsStandard Deviation
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 1,285 EUR is large next to the net profit of 1,816 EUR.

Questions

About this strategy

Can I run Basis Cross Reversion With 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 3 market and timeframe combinations. The best run by trade count was US Crude Oil, 1 hour, with 591 trades.

How large was the drawdown?

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

Short Term RSI Pullback Long Short

Best run on the same market, US Crude Oil.

1.33 PF · 493 trades

ATR Band

Also a mean reversion strategy.

10.31 PF · 53 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