Join waitlist
Strategies / Trend / Moving Average And MACD Long

Moving Average And MACD Long

Buys when the 200 SMA, 100 SMA, 20 EMA and MACD have not risen, with the 20 EMA and price both above the 100 SMA. Exits on a cross of the 20 EMA under the 100 SMA or a 5% fall from the signal close.

TrendLong onlyIntradayGold10 min
1.50Profit factor
2,455Net profit EUR
35.25%Win rate
749Trades
-344Max drawdown
3.28Avg trade

Best run of 44. Gold, 10 min, spread 0.6, from run pf:2026-10-10-GOLD-10m.tsv:1.

Entry rules, long

  1. The 200 SMA has not risen on any of the last 10 bars.
  2. The 100 SMA has not risen over the last 3 bars.
  3. The MACD line (12, 26, 7) has not risen over the last 3 bars.
  4. The 20 EMA is above the 100 SMA, and the close is above the 100 SMA.

Exit rules

  1. The close falls to 5% below the signal close or lower, and the position closes at market.

Test conditions

PeriodUp to 2026-10-10
InstrumentGold, 10 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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run10 min1.50 74935.252,455 EUR-344
Gold5 min1.44 80035.002,254 EUR-424
Nasdaq 10030 min1.42 79439.5513,777 EUR-2,740
Nasdaq 1001 hour1.42 49939.6811,169 EUR-2,535
Nikkei 22530 min1.34 76736.3830,743 USD-6,693
USD/JPY10 min1.32 80039.25433,460 USD-108,040
USD/JPYDailyn/a 3754.051,124,670 USD-378,300
USD/JPY4 hoursn/a 13037.69570,080 USD-189,360
USD/JPY30 minn/a 74535.70485,970 USD-129,980
USD/JPY1 hourn/a 53535.70413,070 USD-235,750
USD/JPY15 minn/a 76735.59405,130 USD-123,940
EUR/USDDailyn/a 4546.6790,162 USD-29,320
Nikkei 225Dailyn/a 4654.3548,569 USD-11,480
Silver4 hoursn/a 10841.6728,093 USD-27,492
Nikkei 22515 minn/a 73638.1823,961 USD-8,190
Silver30 minn/a 74633.3820,908 USD-9,820
Nikkei 22510 minn/a 74136.4420,884 USD-9,153
Silver2 minn/a 75436.0719,103 USD-7,258
Dow JonesDailyn/a 7243.0616,970 EUR-5,863
Nasdaq 100Dailyn/a 6448.4416,481 EUR-3,727
Silver3 minn/a 79333.1715,952 USD-9,349
Nikkei 2254 hoursn/a 11935.2911,685 USD-10,141
DAX 40Dailyn/a 7342.4711,613 EUR-3,843
Nikkei 2253 minn/a 77836.509,874 USD-7,617
Nasdaq 1004 hoursn/a 14946.317,660 EUR-4,053
Nasdaq 1005 minn/a 81136.627,294 EUR-2,183
Dow Jones15 minn/a 62335.156,896 EUR-4,949
DAX 4030 minn/a 79934.675,637 EUR-3,194
Nasdaq 10015 minn/a 79037.975,543 EUR-5,257
DAX 4015 minn/a 79237.375,464 EUR-3,493
Brent Crude2 minn/a 72435.225,238 EUR-1,464
S&P 500Dailyn/a 7542.674,800 EUR-656
DAX 405 minn/a 81234.243,558 EUR-2,714
US Crude Oil2 minn/a 71832.873,423 EUR-1,632
DAX 4010 minn/a 78935.993,178 EUR-2,305
GoldDailyn/a 6439.063,063 EUR-1,108
Gold1 hourn/a 46840.812,419 EUR-908
Gold30 minn/a 73736.912,359 EUR-671
Gold4 hoursn/a 12341.462,194 EUR-979
Gold15 minn/a 76335.651,876 EUR-775
S&P 5004 hoursn/a 15444.161,757 EUR-630
S&P 50030 minn/a 81838.261,213 EUR-810
Gold3 minn/a 78034.741,162 EUR-630
Gold2 minn/a 76335.52998 EUR-372

Charts

Results by run

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

// ==============================================================
// Moving Average And MACD Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 10 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE opened = 0
ONCE stopprice = 0

ema = ExponentialAverage[20](close)
sma = Average[100](close)
smaslow = Average[200](close)
myMacd = MACDLine[12,26,7](close)

emaup = 1
FOR myK = 1 TO 2 DO

39 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

EMASMAMACD
Longer historyRe-run on up to 1,000,000 barsGold · 10 min · older data 884.30 EUR

On the long run with 735,000 bars the net result was 3,339 EUR, against 2,455 EUR on the standard 200,000-bar run. The older data alone gave 884 EUR.

Gold · 10 min

Bars available735,000
Net, standard 200,000-bar run2,454.80 EUR
Net, long run3,339.10 EUR
Net on the older data alone884.30 EUR
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 Moving Average And MACD Long 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 44 market and timeframe combinations. The best run was Gold, 10 minutes, with a profit factor of 1.50 over 749 trades.

How large was the drawdown?

The best run had a maximum drawdown of 344 EUR at the tested position size, against a net result of 2,455 EUR.

Does it trade long, short or both?

It only takes long trades.

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

EMA Cross With RSI Momentum Filter

Also a trend strategy.

1.50 PF · 751 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