Join waitlist
Strategies / Momentum / MACD Cross With Trend Slope

MACD Cross With Trend Slope

The idea buys when the MACD line crosses above its signal line while the 200-period SMA is not falling, and sells short on the mirror-image cross while it is falling. Trades use a 0.5 percent stop and 1.5 percent target.

MomentumLong & shortIntradayGold5 min
n/aProfit factor
2,207Net profit EUR
28.65%Win rate
2,635Trades
-706Max drawdown
0.84Avg trade

Best run of 9. Gold, 5 min, spread 0.6, from run sweeps:2026-10-03-GOLD-5m-opt.tsv:20.

Entry rules, long

  1. Buys 1 contract at market with a 0.5 percent stop and 1.5 percent target

Entry rules, short

  1. Sells 1 contract short at market with a 0.5 percent stop and 1.5 percent target

Exit rules

  1. The 200-bar SMA turns up while a short is open, closing the short at market
  2. A qualifying opposite MACD cross reverses the position
  3. The 0.5 percent stop or 1.5 percent target closes the trade

Test conditions

PeriodUp to 2026-10-03
InstrumentGold, 5 minutes
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-03

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run5 minn/a 2,63528.652,207 EUR-706
USD/JPY10 minn/a 2,30529.72290,960 USD-163,380
EUR/USD2 minn/a 2,46421.9273,026 USD-27,278
EUR/USD3 minn/a 2,53023.8736,724 USD-25,152
EUR/USD4 hoursn/a 1,31427.8534,032 USD-19,066
EUR/USDDailyn/a 52428.8227,879 USD-12,524
Nasdaq 100Dailyn/a 45920.041,980 EUR-1,440
Gold4 hoursn/a 1,14127.171,108 EUR-533
Brent CrudeDailyn/a 20627.67944 EUR-677

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// MACD Cross With Trend Slope
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: 5 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = MACDline[12,26,9](close)
signal = ExponentialAverage[9](myMacd)
sma = Average[200](close)

28 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

MACDSMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run MACD Cross With Trend Slope 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 9 market and timeframe combinations. The best run by trade count was Gold, 5 minutes, with 2,635 trades.

How large was the drawdown?

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

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

ATR Momentum

Also a momentum strategy.

n/a PF · 15,021 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