Join waitlist
Strategies / Trend / DEMA Crossover Long And Short

DEMA Crossover Long And Short

The system buys when DEMA(8) crosses over DEMA(21) and sells short on the opposite cross. Long trades use a 10% stop and 40% target, while short trades use a 5% stop and 10% target, both from the entry price.

TrendLong & shortSwingGold4 hours
n/aProfit factor
2,184Net profit EUR
34.86%Win rate
2,613Trades
-1,206Max drawdown
0.84Avg trade

Best run of 5. Gold, 4 hours, spread 0.6, from run sweeps:2026-10-12-GOLD-4h-opt.tsv:72.

Entry rules, long

  1. DEMA(8) crosses over DEMA(21) while no long position is open.

Entry rules, short

  1. DEMA(8) crosses under DEMA(21) while no short position is open.

Exit rules

  1. A long trade has a stop loss at 10% and a profit target at 40% from the entry price.
  2. A short trade has a stop loss at 5% and a profit target at 10% from the entry price.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, 4 hours
Spread0.6 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
GoldBest run4 hoursn/a 2,61334.862,184 EUR-1,206
SilverDailyn/a 1,06632.3636,959 USD-12,714
DAX 404 hoursn/a 2,58935.3810,124 EUR-6,920
Brent CrudeDailyn/a 45235.408,858 EUR-6,994
GoldDailyn/a 1,13735.622,145 EUR-1,119

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// DEMA Crossover Long And Short
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

emaa = ExponentialAverage[8](close)
demaa = 2 * emaa - ExponentialAverage[8](emaa)
emab = ExponentialAverage[21](close)
demab = 2 * emab - ExponentialAverage[21](emab)

13 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
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 1,206 EUR is large next to the net profit of 2,184 EUR.

Questions

About this strategy

Can I run DEMA Crossover Long And Short 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 5 market and timeframe combinations. The best run by trade count was Gold, 4 hours, with 2,613 trades.

How large was the drawdown?

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

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

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

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