Join waitlist
Strategies / Mean reversion / Detrended Gaussian Crossover Reversion

Detrended Gaussian Crossover Reversion

The strategy smooths a detrended price oscillator with a weighted moving average and trades its crosses against a lagged copy of itself. It buys when the line crosses above its lag below zero and sells short when it crosses below its lag above zero.

Mean reversionLong & shortSwingUS Crude OilDaily
1.95Profit factor
32,194Net profit EUR
44.12%Win rate
170Trades
-8,017Max drawdown
189Avg trade

Best run of 6. US Crude Oil, Daily, spread 3, from run pf:2026-10-12-CRUDE-D.tsv:4.

Entry rules, long

  1. Entries are only taken after the first 160 bars and when no long position is open.

Entry rules, short

  1. Entries are only taken after the first 160 bars and when no short position is open.

Exit rules

  1. A short is closed when the oscillator crosses over its 26-bar lag or over zero.
  2. An opposite entry signal reverses the trade.

Test conditions

PeriodUp to 2026-10-12
InstrumentUS Crude Oil, Daily
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
US Crude OilBest runDaily1.95 17044.1232,194 EUR-8,017
Silver30 minn/a 2,94439.4739,354 USD-29,325
Brent CrudeDailyn/a 6950.7232,934 EUR-5,139
Nikkei 225Dailyn/a 17042.9432,089 USD-23,151
FTSE 1004 hoursn/a 45442.293,874 EUR-2,438
Gold30 minn/a 2,90941.872,287 EUR-755

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Detrended Gaussian Crossover Reversion
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ma = ExponentialAverage[52](close)
dpo = close - ma[27]

alma = 0

34 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

EMA
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Detrended Gaussian Crossover 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 was US Crude Oil, Daily, with a profit factor of 1.95 over 170 trades.

How large was the drawdown?

The best run had a maximum drawdown of 8,017 EUR at the tested position size, against a net result of 32,194 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Short Term RSI Pullback Long Short

Best run on the same market, US Crude Oil.

1.33 PF · 493 trades

Overnight Dip

Also a mean reversion strategy.

1.95 PF · 219 trades

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

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