Join waitlist
Strategies / Trend / MACD SuperTrend DEMA Alignment

MACD SuperTrend DEMA Alignment

Trades MACD histogram crosses in the direction of a SuperTrend trend with 20 and 50 period DEMA alignment, and only when no position is open. Each trade has a 2% stop loss and a 4% profit target.

TrendLong & shortSwingS&P 5004 hours
1.64Profit factor
3,983Net profit EUR
43.96%Win rate
207Trades
-699Max drawdown
19.24Avg trade

Best run of 43. S&P 500, 4 hours, spread 1, from run pf:2026-10-13-USA500-4h.tsv:1.

Entry rules, long

  1. The SuperTrend, using a 10 period ATR multiplied by 3, shows an uptrend.
  2. The 20 period DEMA is above the 50 period DEMA.

Entry rules, short

  1. The SuperTrend shows a downtrend.
  2. The 20 period DEMA is below the 50 period DEMA.

Exit rules

  1. A 4% profit target from the entry price closes the trade.

Test conditions

PeriodUp to 2026-10-13
InstrumentS&P 500, 4 hours
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-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best run4 hours1.64 20743.963,983 EUR-699
Gold4 hours1.63 24146.062,753 EUR-694
GoldDaily1.45 15938.99758 EUR-185
DAX 4015 min1.32 26741.2015,273 EUR-3,564
USD/JPY30 minn/a 15438.96564,250 USD-364,770
USD/JPY10 minn/a 6144.26562,910 USD-275,190
USD/JPY15 minn/a 7841.03399,230 USD-196,210
EUR/USD3 minn/a 3655.5651,249 USD-9,567
EUR/USD5 minn/a 3354.5545,517 USD-17,144
Nikkei 22515 minn/a 33738.8731,827 USD-13,898
Nikkei 2251 hourn/a 41037.8031,208 USD-8,265
Silver15 minn/a 63935.9929,557 USD-12,322
Nikkei 2253 minn/a 13440.3026,652 USD-10,593
Nikkei 2252 minn/a 9343.0126,153 USD-11,218
Nikkei 2254 hoursn/a 20540.0017,963 USD-5,753
Nasdaq 1004 hoursn/a 25642.1911,030 EUR-3,239
Dow Jones1 minn/a 1070.009,550 EUR-2,032
Dow Jones2 minn/a 2250.008,553 EUR-3,730
Nasdaq 10010 minn/a 27736.828,237 EUR-6,650
DAX 4030 minn/a 49736.827,980 EUR-5,090
GBP/USDDailyn/a 13139.697,715 USD-3,600
Dow Jones3 minn/a 4540.006,284 EUR-6,274
FTSE 10010 minn/a 8748.286,074 EUR-999
Brent Crude1 hourn/a 47936.335,737 EUR-5,372
GBP/USD4 hoursn/a 16536.975,331 USD-4,499
Nasdaq 1001 minn/a 2846.435,075 EUR-4,257
SilverDailyn/a 17636.364,965 USD-2,415
DAX 401 hourn/a 46334.564,646 EUR-4,484
DAX 404 hoursn/a 23835.714,155 EUR-2,833
Nasdaq 100Dailyn/a 14933.563,600 EUR-2,072
FTSE 10015 minn/a 20038.003,508 EUR-1,882
FTSE 1005 minn/a 4647.833,053 EUR-1,125
Gold10 minn/a 18840.962,710 EUR-751
Gold1 hourn/a 47238.562,702 EUR-1,042
Gold30 minn/a 40638.922,634 EUR-904
S&P 50015 minn/a 25937.452,418 EUR-1,087
S&P 50010 minn/a 15438.312,347 EUR-1,553
S&P 5001 hourn/a 44235.972,222 EUR-1,111
Gold15 minn/a 24839.521,945 EUR-1,409
FTSE 1003 minn/a 3046.671,774 EUR-1,430
Gold5 minn/a 14440.971,641 EUR-1,564
S&P 5002 minn/a 2147.621,166 EUR-723
S&P 5001 minn/a 966.671,146 EUR-430

Charts

Results by run

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

// ==============================================================
// MACD SuperTrend DEMA Alignment
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE upline = 0
ONCE dnline = 0
ONCE trend = 1

myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close)
sig = ExponentialAverage[9](myMacd)
delta = myMacd - sig

myAtr = AverageTrueRange[10](close)
up = MedianPrice + 3 * myAtr
dn = MedianPrice - 3 * myAtr
prevup = upline
prevdn = dnline

36 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

MACDSuperTrendATREMA
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 MACD SuperTrend DEMA Alignment 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 43 market and timeframe combinations. The best run was S&P 500, 4 hours, with a profit factor of 1.64 over 207 trades.

How large was the drawdown?

The best run had a maximum drawdown of 699 EUR at the tested position size, against a net result of 3,983 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

Ichimoku Cloud Chikou Touch

Also a trend strategy.

1.64 PF · 503 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