Strategies we backtested MACD + 200 EMA

Tested by BacktestingMax

MACD + 200 EMA strategy backtest

Does the MACD + 200 EMA strategy make money?

Mostly no. We backtested the MACD + 200 EMA strategy on 10 markets: 4 currency pairs, gold, silver and 4 stock indices. Each market ran on 5-minute, 15-minute, 1-hour and 4-hour charts: 40 backtests from 2019 to 2025, after trading costs. 8 of the 40 made money, all on 1-hour and 4-hour charts. Only 5 made money in both 2019–2022 and 2023–2025: USD/JPY, the S&P 500, the Nasdaq 100 and the Dow Jones on 4-hour charts, and the Nasdaq 100 on 1-hour charts. All 20 tests on 5-minute and 15-minute charts lost money. The 200 EMA is a moving average of the last 200 closing prices. MACD measures momentum with two lines that move above and below zero: the MACD line and a slower signal line. The strategy buys when price is above the 200 EMA and the MACD line crosses above the signal line below zero. It sells short when price is below the 200 EMA and the MACD line crosses below the signal line above zero. Each trade aims to win 1.5 times what it risks, so the strategy needs 40% winners to break even before costs. It won 39% to 42% on each chart. The 200 EMA filter mattered most in the newer years: in 2023–2025, 8 tests made money with the filter, and only 3 without it.

40 backtests 2019–2025 Trading costs included Tested 16 November 2026

Where it worked 40 backtests
Made money
8
of 40 tests, with the standard rules
Made money in both periods
5
2019–2022 and again 2023–2025
Best backtest
+30%
Gold, 1-hour chart: account growth 2019–2025
A take-profit at 2 times the risk
2
tests made money in both periods, compared with 5 with the standard rules

Made money in both periods

  • USD/JPY, 4-hour
  • S&P 500, 4-hour
  • Nasdaq 100, 1-hour
  • Nasdaq 100, 4-hour
  • Dow Jones, 4-hour

Lost money on every market

  • 5-minute charts
  • 15-minute charts

The results

Results on every market

Each box shows one backtest of the MACD + 200 EMA with the standard rules, from 2019 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2019–2022 and 2023–2025, or passed all four of our checks (see "How a test passes" further down).

Market 5-minute 15-minute 1-hour 4-hour
EUR/USD −100% Lost money. Account down 90% by Jun 2020 −65% Lost money −16% Lost money −13% Lost money
GBP/USD −100% Lost money. Account down 90% by Jun 2021 −84% Lost money −22% Lost money −4% Lost money
USD/JPY −99% Lost money. Account down 90% by Oct 2020 −43% Lost money −36% Lost money +19% Passed all four checks
AUD/USD −100% Lost money. Account down 90% by Dec 2019 −91% Lost money. Account down 90% by Sept 2025 −18% Lost money +7% Made money overall, lost in one period
Gold −99% Lost money. Account down 90% by Mar 2021 −65% Lost money +30% Made money overall, lost in one period −3% Lost money
Silver −100% Lost money. Account down 90% by Apr 2019 −95% Lost money. Account down 90% by Nov 2023 −42% Lost money −13% Lost money
S&P 500 −100% Lost money. Account down 90% by Oct 2020 −60% Lost money +23% Made money overall, lost in one period +16% Made money in both periods
Nasdaq 100 −94% Lost money. Account down 90% by Sept 2024 −29% Lost money +16% Made money in both periods +29% Passed all four checks
Dow Jones −96% Lost money. Account down 90% by Oct 2024 −28% Lost money −39% Lost money +15% Made money in both periods
DAX −89% Lost money. Account down 90% by Jul 2023 −80% Lost money −4% Lost money −2% Lost money
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2019–2022 2023–2025 Monte Carlo drawdown Trading costs
EUR/USD 5-minute 4,028 38.4% 0.73 −99.7% −99.7% −98.6% −76.4% −99.7% $6,509
EUR/USD 15-minute 1,970 40.7% 0.95 −65.3% −84.3% −8.2% −62.2% −78.9% $12,037
EUR/USD 1-hour 475 40% 0.94 −16.3% −20.2% −11.6% −5.3% −40.5% $1,295
EUR/USD 4-hour 128 35.9% 0.83 −12.8% −17.6% −3.3% −9.8% −24.9% $138
GBP/USD 5-minute 3,925 38.5% 0.79 −99.6% −99.6% −98.1% −78.5% −99.7% $8,235
GBP/USD 15-minute 1,962 39.2% 0.89 −84.0% −87.0% −48.2% −69.1% −88.7% $7,576
GBP/USD 1-hour 503 39.6% 0.92 −21.7% −29.6% −11.0% −12.0% −43.0% $1,381
GBP/USD 4-hour 134 39.6% 0.95 −3.7% −15.6% −4.3% +0.6% −21.0% $161
USD/JPY 5-minute 5,192 40.5% 0.79 −99.0% −99.3% −97.2% −63.5% −99.3% $8,626
USD/JPY 15-minute 1,844 41% 0.95 −43.2% −46.7% −14.4% −33.7% −68.7% $7,087
USD/JPY 1-hour 456 37.5% 0.83 −36.4% −48.8% −35.4% −1.5% −49.4% $872
USD/JPY 4-hour 107 48.6% 1.33 +19.4% −4.4% +12.9% +5.8% −12.3% $104
AUD/USD 5-minute 3,225 38.4% 0.69 −99.8% −99.8% −99.3% −67.9% −99.8% $7,642
AUD/USD 15-minute 1,944 38.4% 0.85 −91.0% −92.5% −66.0% −73.4% −93.0% $7,176
AUD/USD 1-hour 458 40% 0.94 −18.2% −32.1% +9.8% −25.5% −40.4% $1,624
AUD/USD 4-hour 110 43.6% 1.11 +7.0% −11.6% +10.2% −2.9% −15.8% $165
Gold 5-minute 2,999 38.8% 0.75 −99.3% −99.3% −98.4% −55.2% −99.4% $9,419
Gold 15-minute 1,805 40.6% 0.90 −65.4% −69.8% −45.4% −36.6% −77.1% $6,850
Gold 1-hour 460 43.7% 1.13 +29.9% −30.5% −9.0% +42.7% −25.6% $1,127
Gold 4-hour 105 40% 0.95 −2.5% −11.6% +4.6% −6.8% −16.7% $111
Silver 5-minute 472 25.6% 0.20 −99.6% −99.6% −99.6% −4.4% −99.6% $6,924
Silver 15-minute 1,545 39% 0.62 −95.2% −95.3% −86.7% −64.1% −95.9% $7,768
Silver 1-hour 474 38.6% 0.77 −42.0% −49.5% −33.1% −13.3% −51.7% $2,414
Silver 4-hour 117 36.8% 0.81 −13.0% −23.7% −4.6% −8.8% −23.0% $421
S&P 500 5-minute 4,650 38.7% 0.75 −99.7% −99.7% −97.3% −88.0% −99.7% $6,677
S&P 500 15-minute 1,657 39.9% 0.90 −60.4% −68.1% −51.8% −17.9% −74.8% $3,846
S&P 500 1-hour 428 42.8% 1.07 +22.6% −17.0% +31.8% −7.0% −27.5% $892
S&P 500 4-hour 120 45.8% 1.23 +16.0% −6.3% +11.1% +4.4% −13.5% $74
Nasdaq 100 5-minute 5,059 41.2% 0.87 −93.8% −93.9% −75.9% −74.2% −96.2% $10,604
Nasdaq 100 15-minute 1,604 40.9% 0.96 −29.2% −39.2% −16.6% −15.1% −61.6% $4,499
Nasdaq 100 1-hour 412 42.5% 1.06 +16.3% −11.7% +12.9% +3.0% −26.8% $692
Nasdaq 100 4-hour 110 50.9% 1.54 +29.2% −4.6% +18.8% +8.8% −9.8% $56
Dow Jones 5-minute 4,999 39.5% 0.91 −96.3% −96.5% −59.4% −91.0% −97.6% $9,098
Dow Jones 15-minute 1,713 40.6% 0.96 −27.5% −51.5% −29.1% +2.2% −61.3% $3,154
Dow Jones 1-hour 463 36.3% 0.83 −39.0% −43.4% −8.9% −33.0% −49.8% $485
Dow Jones 4-hour 121 45.5% 1.28 +15.4% −6.6% +10.3% +4.6% −11.5% $48
DAX 5-minute 5,058 40.6% 0.91 −89.0% −90.6% −80.7% −42.9% −94.3% $7,378
DAX 15-minute 1,696 37.5% 0.85 −80.3% −83.6% −67.1% −40.1% −85.1% $2,132
DAX 1-hour 432 39.6% 0.98 −4.4% −19.1% +7.1% −10.7% −33.2% $456
DAX 4-hour 124 38.7% 0.97 −2.2% −15.9% +0.8% −3.0% −18.3% $45

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2019–2022 and 2023–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test Gold, 1-hour chart +29.9% from 2019 to 2025
Middle test (median): half of the 40 did better, half did worse USD/JPY, 1-hour chart −36.4% from 2019 to 2025

What we found

What the 40 backtests show

  1. With the standard rules, 8 of the 40 tests made money from 2019 to 2025, after trading costs, all on 1-hour and 4-hour charts. On 4-hour charts, 5 of the 10 markets made money. The account grew by 29.2% on the Nasdaq 100, 19.4% on USD/JPY, 16.0% on the S&P 500, 15.4% on the Dow Jones and 7.0% on AUD/USD. All of them except AUD/USD made money in both 2019–2022 and 2023–2025. USD/JPY and the Nasdaq 100 also passed all four of our checks (see 'How a test passes'). But with the standard rules, each 4-hour test made only 105 to 134 trades, about 15 to 19 a year. On 1-hour charts, the account grew by 29.9% on gold, 22.6% on the S&P 500 and 16.3% on the Nasdaq 100. Only the Nasdaq 100 made money in both periods. Gold lost 9.0% in 2019–2022 and made 42.7% in 2023–2025. The S&P 500 made 31.8%, then lost 7.0%. On 5-minute and 15-minute charts, all 20 tests lost money, and on average their trades lost money even before trading costs.

  2. The 200 EMA filter made the biggest difference in 2023–2025. Without it, with only the zero-line rule, 13 of the 40 tests made money in 2019–2022, compared with 11 with it. But in 2023–2025, only 3 made money without it, compared with 8 with it. R is the money one trade risks: 1% of the account at the time of the trade. For example, +0.069R means that a trade made, on average, 6.9% of the money it risked. On 4-hour charts, the buys did about the same with or without the filter: +0.069R and +0.078R per trade on average. The sells made +0.004R each with the filter, which allows a sell only below the 200 EMA. Without it, they lost 0.070R each. On the 4-hour charts of the S&P 500, the Nasdaq 100 and the Dow Jones, the 99 sells of the standard rules made 0.213R each. Without the filter, 597 sells there lost 0.087R each.

  3. The zero-line rule mattered less. About 1 MACD cross in 2 passed the 200 EMA filter, but only about 1 in 5 passed both filters (see the first table below). Without the zero-line rule, the strategy trades every cross in the direction of the 200 EMA, wherever the MACD line is. From 2019 to 2025, that made money in 8 of 40 tests, the same number as the standard rules. It made money in fewer tests in 2019–2022 (8, against 11) and in more tests in 2023–2025 (10, against 8). Only 3 made money in both periods, compared with 5. On 4-hour charts, the zero-line rule cut the trades from 2,012 to 1,176. The average trade rose from +0.030R to +0.043R, but with fewer trades, the total fell from +60.8R to +50.7R.

  4. Putting the stop-loss at the 200 EMA, which some traders do instead of using the recent swing, did worse on every chart. After a pullback, price is often close to the 200 EMA when the MACD lines cross, so this stop-loss was often very close. On 1-hour charts, 12.8% of these stop-losses were less than 5 spreads from the price, compared with 1.1% of the swing stop-losses. The spread is the gap between the buy price and the sell price, the main trading cost in these tests. With a close stop-loss, the spread is a bigger part of the money at risk: it took 0.080R per 1-hour trade, against 0.028R with the swing stop-loss. The trades also did worse before costs. With the stop-loss at the 200 EMA, 4 of the 40 tests made money. Only the S&P 500 on the 4-hour chart made money in both periods with 100 trades or more.

  5. On 4-hour charts, the market mattered more than the version. The S&P 500 and the Nasdaq 100 made money with the standard rules and with all 4 changes, and the Dow Jones with 4 of the 5 versions. EUR/USD and silver lost money with all 5 (see the second table below). On 5-minute and 15-minute charts, none of the 5 versions made money on any market: 0 of 100 tests.

Which filter matters?

Without the 200 EMA, only 3 tests made money in 2023–2025

The standard rules put two filters on each MACD cross. The 200 EMA filter: buy only above the 200 EMA, and sell only below it. The zero-line rule: buy only when the MACD line is below zero, and sell only when it is above zero. We ran the same 40 tests with both filters, with one of them, and with neither. The last row is not one of the 4 changes under 'Can the MACD + 200 EMA be improved?': it trades every MACD cross.

Filters Share of MACD crosses the filters allow Tests that made money, 2019–2022 Tests that made money, 2023–2025 Average 4-hour trade in R, 2019–2022 Average 4-hour trade in R, 2023–2025
Both (the standard rules) About 1 in 5 11 of 40 8 of 40 +0.086R −0.011R
200 EMA only About 1 in 2 8 of 40 10 of 40 +0.053R +0.003R
Zero-line rule only About 6 in 10 13 of 40 3 of 40 +0.034R −0.052R
Neither: every cross All 11 of 40 3 of 40 +0.042R −0.050R

'Share of MACD crosses the filters allow' counts every cross of the MACD line and the signal line on the 10 markets from 2019 to 2025. It includes crosses that came while a trade was open. On each of the 4 charts, 18.8% to 20.5% of the crosses passed both filters. Each average is the result of one trade after trading costs, in R, over all 10 markets on 4-hour charts. A trade counts in the period in which it closed. With both filters, there were 657 of these trades in 2019–2022 and 519 in 2023–2025. With neither filter, there were 1,687 and 1,389.

4-hour charts, market by market

On 4-hour charts, the S&P 500 and the Nasdaq 100 made money with all 5 versions

Each cell is one backtest from 2019 to 2025, after trading costs: the % change of the account, risking 1% of the account on each trade. The versions are the standard rules and the 4 changes under 'Can the MACD + 200 EMA be improved?'.

Market Standard rules Any cross with the trend No 200 EMA Stop-loss at the 200 EMA Take-profit at 2 times the risk
EUR/USD −12.8% −9.2% −10.3% −3.3% −10.2%
GBP/USD −3.7% −1.9% +40.6% −5.1% −2.1%
USD/JPY +19.4% +4.3% −2.3% +5.1% +28.5%
AUD/USD +7.0% +2.7% −19.9% −12.2% +8.2%
Gold −2.5% +13.2% −10.5% −2.3% −3.3%
Silver −13.0% −13.5% −29.5% −29.2% −10.2%
S&P 500 +16.0% +6.2% +13.9% +15.8% +29.7%
Nasdaq 100 +29.2% +36.4% +15.4% +21.5% +39.7%
Dow Jones +15.4% +16.6% −5.4% +5.7% +15.3%
DAX −2.2% +2.5% −11.1% −4.0% 0.0%

Across the 5 versions, each 4-hour backtest made 91 to 354 trades. 6 of them made fewer than 100. With the stop-loss at the 200 EMA, these were USD/JPY and the Nasdaq 100 (91 and 92 trades). With the take-profit at 2 times the risk, they were USD/JPY, AUD/USD, gold and the Nasdaq 100 (95 to 99 trades). With that take-profit, the DAX ended almost exactly where it started: +0.03%, shown as 0.0%. Without the wrong prices in our DAX data, the DAX lost 0.9% instead of making 2.5% with any cross with the trend (see 'DAX data').

The strategy

What the MACD + 200 EMA is

MACD + 200 EMA is a trend-following strategy: it waits for price to pull back against the trend, then trades when the move with the trend starts again. It uses two indicators. The 200 EMA is a moving average of the last 200 closing prices that gives more weight to recent candles. Many traders read price above the 200 EMA as an uptrend, and price below it as a downtrend. MACD is an indicator that measures momentum: how fast, and in which direction, price is moving. The MACD line is the gap between two EMAs, one over the last 12 candles and one over the last 26. The signal line is the EMA of the MACD line over its last 9 values, so it moves more smoothly. The MACD line is below zero when the 12-candle EMA is below the 26-candle EMA, which happens after price has fallen for a while. So in an uptrend, a MACD cross up below zero is read as the end of a pullback, and that is when the strategy buys. Sells work the other way round: price below the 200 EMA, and a MACD cross down above zero. On this page, we call this condition, a cross below zero for a buy and above zero for a sell, the zero-line rule.

MACD
12, 26 and 9, on closing prices: the default on most charting platforms. The MACD line is the 12-candle EMA minus the 26-candle EMA. The signal line is the 9-candle EMA of the MACD line. We calculated MACD and the 200 EMA ourselves, on the same candles as the rules (see 'Price data'). The first value of each EMA is the first closing price, and no trade opens before the 200th candle.
200 EMA
The 200-candle EMA of the closing price. A buy needs the candle of the cross to close above it. A sell needs it to close below it.
MACD cross
A cross up: on the candle before, the MACD line was at or below the signal line, and at this candle's close it is above it. The cross counts as below zero when the MACD line is below zero at that close. A cross down is the same the other way round, and it counts as above zero when the MACD line is above zero.
Stop-loss
The recent swing: the lowest low of the last 10 candles for a buy, and the highest high for a sell. The 10 candles include the candle of the cross. Traders say 'the recent swing' without a number, so 10 candles is our choice. The stop-loss does not move. On EUR/USD, half of the stop-losses were less than 6.1 pips from the close of the candle of the cross on 5-minute charts. They were less than 12.3 pips away on 15-minute charts, 26.8 pips on 1-hour charts and 63.8 pips on 4-hour charts.
Take-profit
1.5 times the stop-loss distance, measured from the close of the candle of the cross. It does not move. Every trade ended at its stop-loss or its take-profit, except 7 trades that were still open when the tests ended.
Entry
A market order at the open of the candle after the cross. The trade size, the stop-loss and the take-profit are set from the close of the candle of the cross. So when price moves between that close and the next open, the trade risks a little more or a little less than planned.
Risk per trade
1% of the account at that time. The account started at $10,000. The trade size is rounded down to a size the market allows. The value of a trade can be at most 30 times the account on currency pairs, and 20 times on gold, silver and the indices (this limit is called leverage). When the stop-loss is very close, a 1% risk needs a bigger trade than that. Then the trade is cut to the limit, and it risks less than 1%. With the standard rules, it happened to 342 trades on 5-minute charts, 108 on 15-minute charts and 2 on 1-hour charts. These counts include only trades placed while the account still had at least half of its money. A loss can also be bigger than 1% when price jumps past the stop-loss. 392 trades lost more than 1.5% of the account on 5-minute charts, 86 on 15-minute charts, 5 on 1-hour charts and 1 on 4-hour charts. On 1-hour charts, the biggest was a USD/JPY sell. It lost 4.6% of the account when the market opened far above its stop-loss after the weekend of 4 October 2025. On 5-minute charts, the biggest loss, 23.6% of the account, came from a wrong price in our DAX data (see 'DAX data').
Trading costs
The spread: the gap between the buy price and the sell price. Currency pairs: 0.8 pips on EUR/USD, 1.2 on GBP/USD, 0.9 on USD/JPY and 1.0 on AUD/USD (a pip is 0.0001, or 0.01 on USD/JPY). Metals: $0.30 an ounce on gold and $0.020 on silver. Stock indices: 0.4 points on the S&P 500, 1.5 on the Nasdaq 100, 2.0 on the Dow Jones and 1.0 on the DAX. For silver, the Nasdaq 100, the Dow Jones and the DAX, these are wider than our backtest engine's default spreads, to match a typical retail broker. Our spreads stay the same at all times, but real spreads widen around news and at the daily rollover. No commission. The entry is a market order, so it pays half the spread. A trade that closes at its stop-loss pays the other half. The take-profit is a limit order: it pays no spread, but it fills only when price trades through the limit. Our charts show the sell price (the bid), and the buy price (the ask) is one spread higher. So the take-profit of a sell, which is a buy order, fills only when the chart price goes one spread below it. With the standard rules, the half spreads took 0.097R per trade on average on 5-minute charts, 0.061R on 15-minute charts, 0.028R on 1-hour charts and 0.011R on 4-hour charts. These numbers leave out the fill rule for take-profits, which costs no money but makes some take-profits harder to reach.
Smallest trade size
Each market has a smallest trade: 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver or 0.1 of an index contract. When the trade that risks 1% would be smaller than that, the backtest skips the signal (a MACD cross that passes both filters). With the standard rules, while an account still had at least half of its money, the backtests skipped few signals. They skipped 1 on 5-minute charts, 6 on 15-minute charts, 14 on 1-hour charts (7 on silver and 7 on the Dow Jones) and 9 on 4-hour charts. Accounts that had lost more than half of their money skipped many more: 23,630 signals on 5-minute charts and 570 on 15-minute charts. On 5-minute charts, 904 more signals were refused, because these small accounts did not have enough margin even for the smallest trade. The silver account on the 5-minute chart was down 90% by April 2019, so that test made only 472 trades.
Overnight fees
Not included. Brokers charge a fee (a swap), or sometimes pay one, for each night a trade stays open past 17:00 New York time. With the standard rules, half of the trades lasted longer than about 1 hour on 5-minute charts, and 3 hours on 15-minute charts. On 1-hour charts, half lasted longer than 12 hours, and on 4-hour charts longer than 3 days. So these fees would change the 4-hour results most, and they could make a result better or worse.
Price data
CFD prices: the prices a broker quotes for a CFD (contract for difference), the product most brokers outside the US offer for trading these markets. The strategy skips two kinds of candle, and these candles don't count for MACD, the 200 EMA or the recent swing. First, on some Fridays, the data has a few minutes of prices after the weekly close at 17:00 New York time, which make a tiny extra candle. Second, some candles show no price change at all (the high equals the low), for example on market holidays. On every market and chart, these were less than 1% of the candles.
DAX data
Our DAX data has some wrong prices, and the results on this page include them, because we test on our price data as it is. The wrong prices come at times with no trading, mostly between 22:00 and 23:00 German time. From 2019 to 2025, they appear on 44 days. They are typically about 1.2% away from the last real price, and at most 3.7% away. We ran the DAX backtests again without them. With the standard rules, the 5-minute backtest then lost 78.4%, not the 89.0% shown on this page. On 6 July 2023, one wrong price closed a sell about 270 points above its stop-loss, for a loss of 23.6% of the account. Without that price, the trade reached its take-profit, and the account never fell 90%. The other DAX results with the standard rules, from 2019 to 2025, changed by 0.9 percentage points or less (for example, the 4-hour result went from −2.2% to −3.1%). But in 2019–2022 alone, the 4-hour backtest lost 0.2% instead of making 0.8%. So without the wrong prices, 10 of the 40 tests made money in 2019–2022 with the standard rules, not 11. With any cross with the trend, the 1-hour backtest made 20.0% instead of 9.7%, and the 4-hour backtest lost 0.9% instead of making 2.5%. With no 200 EMA, the 15-minute and 1-hour backtests lost 91.3% and 22.9% instead of 80.2% and 11.6%. With the take-profit at 2 times the risk, the 5-minute backtest lost 13.2% instead of 65.6%. None of this changes which change we picked, or how many tests made money in both periods.
Wrong prices on other markets
We checked the other 9 markets for the same problem: minutes with no trading, at a price more than 0.75% away from the last price with trading. From 2019 to 2025, it happened on one day, on silver. On 1 June 2023, 7 of these minutes had prices up to 1.5% away from the last price with trading. Without these 7 minutes, silver's results changed by 1.1 percentage points or less.

The rules we tested

  1. Use MACD with its standard settings, 12, 26 and 9, and a 200 EMA, both on closing prices. We check the rules when each candle closes, and a trade opens at the next candle's open.
  2. Buy when the candle closes above the 200 EMA, and the MACD line crosses above the signal line while the MACD line is below zero.
  3. Sell short when the candle closes below the 200 EMA, and the MACD line crosses below the signal line while the MACD line is above zero. A short trade makes money if price falls.
  4. Put the stop-loss at the recent swing: the lowest low of the last 10 candles for a buy, and the highest high of the last 10 candles for a sell. The 10 candles include the candle of the cross.
  5. Put the take-profit 1.5 times as far from the close as the stop-loss. So a winning trade makes about 1.5 times what a losing trade loses.
  6. Risk 1% of the account on each trade. Hold one trade at a time: crosses that come while a trade is open are ignored. The stop-loss and the take-profit don't move.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, USD/JPY, AUD/USD, Gold, Silver, S&P 500, Nasdaq 100, Dow Jones and DAX
Charts
5-minute, 15-minute, 1-hour and 4-hour candles
Dates
January 2019 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2019 to 2022 and again from 2023 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2023 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the MACD + 200 EMA be improved?

We tried four changes traders make to the MACD + 200 EMA strategy. Two of them drop one of the two filters: the zero-line rule, or the 200 EMA. The other two change the exits: a stop-loss at the 200 EMA instead of the recent swing, and a take-profit at 2 times the risk (2R) instead of 1.5 times. Each change ran on the same 40 tests. If you choose a change on some years and judge it on the same years, it will almost always look good. So we chose the change that made money in the most tests in 2019–2022. If two changes tied, we chose the one with the better middle test (the median: half of the 40 tests did better, half did worse). Then we checked it on 2023–2025, years we did not use to choose it.

Version Made money 2019–2022years used to pick the best version Made money 2023–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules The rules under 'The rules we tested': the 200 EMA filter, the zero-line rule, the stop-loss at the recent swing and the take-profit at 1.5 times the risk. 11 of 40middle test −15.5% 8 of 40middle test −14.2% 5 2
Any cross with the trend No zero-line rule. Buy at every MACD cross up while price is above the 200 EMA, and sell at every cross down while price is below it, wherever the MACD line is. 8 of 40middle test −29.1% 10 of 40middle test −16.1% 3 1
No 200 EMA Keep the zero-line rule, but drop the 200 EMA. Buy at every MACD cross up below zero, and sell at every cross down above zero, on either side of the 200 EMA. 13 of 40middle test −36.4% 3 of 40middle test −18.8% 2 1
A stop-loss at the 200 EMA Put the stop-loss at the 200 EMA instead of the recent swing, as some traders do. The take-profit is still 1.5 times the stop-loss distance. 8 of 40middle test −48.1% 6 of 40middle test −20.1% 1 1
A take-profit at 2 times the riskBest on 2019–2022 Put the take-profit 2 times as far from the close as the stop-loss (2R), instead of 1.5 times (1.5R). 13 of 40middle test −22.4% 9 of 40middle test −18.0% 2 1

Not clearly. In 2019–2022, the years we used to pick the best change, two changes made money in 13 of 40 tests: the take-profit at 2R, and dropping the 200 EMA. The standard rules made money in 11. The 2R take-profit was picked, because its middle test lost less: −22.4%, against −36.4%. In 2023–2025, it made money in 9 of 40 tests, compared with 8 for the standard rules. Dropping the 200 EMA made money in only 3. With the 2R take-profit, 4 tests made money in both periods, all on 4-hour charts: the S&P 500, the Dow Jones, USD/JPY and the Nasdaq 100. But USD/JPY and the Nasdaq 100 made fewer than 100 trades each, so the table counts only 2, compared with 5 with the standard rules. On 4-hour charts, the 2R take-profit raised the average trade from +0.043R to +0.082R, but on 15-minute charts it lowered it from −0.067R to −0.082R. The stop-loss at the 200 EMA did worse than the swing stop-loss on every chart.

Passed all four checks with A take-profit at 2 times the risk

  • S&P 500, 4-hour

Questions

Questions traders ask

Does the MACD + 200 EMA strategy work?

Mostly no. In our backtest from 2019 to 2025, after trading costs, the standard rules made money in 8 of 40 tests, all on 1-hour and 4-hour charts. Only 5 made money in both 2019–2022 and 2023–2025: USD/JPY, the S&P 500, the Nasdaq 100 and the Dow Jones on 4-hour charts, and the Nasdaq 100 on 1-hour charts. All 20 tests on 5-minute and 15-minute charts lost money, and so did all 4 changes we tried on those charts.

What is the win rate of the MACD + 200 EMA strategy?

About 40% in our backtests. 39.4% of the trades won on 5-minute charts, 39.8% on 15-minute charts, 40.0% on 1-hour charts and 42.3% on 4-hour charts. With the take-profit at 1.5 times the risk, 40% winners only break even before trading costs. Single tests ranged from 25.6% (silver, 5-minute chart) to 50.9% (the Nasdaq 100, 4-hour chart). With the take-profit at 2 times the risk, the win rate fell to 33% to 37%.

What is the best timeframe for the MACD + 200 EMA strategy?

In our tests, the 4-hour chart. There, 5 of the 10 markets made money with the standard rules, 4 of them in both 2019–2022 and 2023–2025. On 1-hour charts, 3 of 10 made money, but only the Nasdaq 100 in both periods. On 5-minute and 15-minute charts, none did. The 4-hour tests made only about 15 to 19 trades a year on each market, so each result rests on 105 to 134 trades.

Does the 200 EMA filter make the MACD strategy better?

In this test, yes, but mostly in the newer years. Without the 200 EMA, with only the zero-line rule, 13 of 40 tests made money in 2019–2022, compared with 11 with it. In 2023–2025, only 3 made money without it, compared with 8 with it. The filter helped most with sells. On the 4-hour charts of the three US stock indices, sells made money with the filter and lost money without it.

Keep exploring

Related strategies we tested

MACD MACD crossover strategy backtest Made money in 6 of 21 tests, 4 of them in both periods. Best: DAX, 1-hour, +294% MACD MACD divergence strategy backtest Made money in 4 of 18 tests, 2 of them in both periods. Best: USD/JPY, 1-hour, +66% RSI RSI + 50 EMA strategy backtest Made money in 4 of 24 tests, 2 of them in both periods. Best: Nasdaq 100, 1-hour, +40% Moving averages Best EMA crossover: 7 EMA pairs backtested on 10 markets Made money in 11 of 40 tests, 5 of them in both periods. Best: USD/JPY, 1-hour, +167% VWAP VWAP + 9 EMA strategy backtest on NQ and ES futures Made money in 5 of 6 tests, 0 of them in both periods. Best: MNQ (Micro Nasdaq 100), 15-minute, +91% Moving averages 9/21 EMA crossover backtest: from 5-minute to daily charts Made money in 10 of 40 tests, 5 of them in both periods. Best: USD/JPY, 1-hour, +539%
The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class Macd200Ema(Strategy):
    """MACD + 200 EMA: the MACD crossover traded only with the trend of the 200 EMA, and only
    after a pullback, as many YouTube videos show it. Plus four common changes.
    MACD (12, 26, 9): the MACD line is the 12-candle EMA of the close minus the 26-candle EMA.
    The signal line is the 9-candle EMA of the MACD line. The 200 EMA is the EMA of the
    closes over 200 candles. An EMA counts the newest close 2 / (length + 1), the rest of it
    is the EMA of the candle before; it starts at the first close, as the built-in EMA does.
    Standard (all switches off), checked when each candle closes:
      Buy at the next candle's open when
        - the candle closes above the 200 EMA,
        - the MACD line crosses above the signal line on this candle,
        - and the cross happens below zero (the MACD line is still below zero after it).
      Sell short at the next candle's open when the candle closes below the 200 EMA and the
      MACD line crosses below the signal line above zero.
      Stop-loss at the recent swing: the lowest low of the last 10 candles for a buy (the
      highest high for a sell), the signal candle included.
      Take-profit at 1.5R: 1.5 times the stop-loss distance, measured from the signal
      candle's close. The stop-loss and the take-profit are the only exits.
      One trade at a time: a signal while a trade is open is skipped.
      Size: the trade loses 1% of the account if the stop-loss is hit.
      No trade until the 200 EMA has 200 candles.
    Skipped candles: a flat candle (high = low: no price moved, e.g. a market holiday) and a
    candle that opens on a Friday at 17:00 New York time or later, before the Sunday open (some
    index data has a few minutes of prices after the weekly close). The strategy ignores them
    completely: they do not go into the EMAs or the swing, and they are never signal candles.
    That is why the EMAs are worked out here instead of with the built-in indicators. On a
    market that trades at the weekend (crypto), remove the weekend part of the skip.
    The changes, one at a time:
      no_zero  = 1  every cross in the trend's direction counts, above or below zero
      no_ema   = 1  no 200 EMA: buy on any cross below zero, sell on any cross above zero
      ema_stop = 1  stop-loss at the 200 EMA instead of the recent swing
      target_r = 2  take-profit at 2R instead of 1.5R
    """
    params = {"fast": Param(type=int, default=12, min=2, max=50),
              "slow": Param(type=int, default=26, min=5, max=100),
              "signal": Param(type=int, default=9, min=2, max=50),
              "ema_period": Param(type=int, default=200, min=10, max=500),
              "swing_bars": Param(type=int, default=10, min=2, max=50),
              "target_r": Param(type=float, default=1.5, min=0.5, max=10.0),
              "no_zero": Param(type=int, default=0, min=0, max=1),
              "no_ema": Param(type=int, default=0, min=0, max=1),
              "ema_stop": Param(type=int, default=0, min=0, max=1)}
    lookback = 2
    def init(self, ctx):
        self.ny = ctx.clock("America/New_York")
        self.count = 0             # candles used so far
        self.fast = None           # 12-candle EMA
        self.slow = None           # 26-candle EMA
        self.signal = None         # 9-candle EMA of the MACD line
        self.trend = None          # the 200 EMA
        self.prev_macd = None      # the MACD line and the signal line on the candle before
        self.prev_signal = None
        self.lows = []             # lows and highs of the last 10 candles used
        self.highs = []
    @staticmethod
    def step(ema, value, length):
        """One EMA step: the newest value counts 2 / (length + 1)."""
        return value if ema is None else ema + 2.0 / (length + 1) * (value - ema)
    def on_bar(self, ctx):
        p = ctx.params
        # A flat candle, or a candle after the weekly close: ignore it completely.
        wd, hour = self.ny.weekday, self.ny.hour
        after_close = (wd == 4 and hour >= 17) or wd == 5 or (wd == 6 and hour < 17)
        if ctx.high[0] == ctx.low[0] or after_close:
            return
        c = ctx.close[0]
        self.count += 1
        self.fast = self.step(self.fast, c, p.fast)
        self.slow = self.step(self.slow, c, p.slow)
        self.trend = self.step(self.trend, c, p.ema_period)
        m0 = self.fast - self.slow
        self.signal = self.step(self.signal, m0, p.signal)
        s0 = self.signal
        m1, s1 = self.prev_macd, self.prev_signal
        self.prev_macd, self.prev_signal = m0, s0
        self.lows = (self.lows + [ctx.low[0]])[-p.swing_bars:]
        self.highs = (self.highs + [ctx.high[0]])[-p.swing_bars:]
        if self.count < p.ema_period or m1 is None or s1 is None:
            return
        if ctx.position is not None:
            return  # the stop-loss or the take-profit ends the trade
        cross_up = m1 <= s1 and m0 > s0
        cross_down = m1 >= s1 and m0 < s0
        if not ctx.gate("macd_crosses_signal", cross_up or cross_down):
            return
        side = 1 if cross_up else -1
        with_trend = c > self.trend if side == 1 else c < self.trend
        if not ctx.gate("with_the_200_ema", p.no_ema == 1 or with_trend):
            return
        beyond_zero = m0 < 0 if side == 1 else m0 > 0
        if not ctx.gate("cross_below_zero_for_buys_above_for_sells", p.no_zero == 1 or beyond_zero):
            return
        if p.ema_stop == 1:
            stop = self.trend
        else:
            stop = min(self.lows) if side == 1 else max(self.highs)
        if not ctx.gate("stop_on_the_right_side", (stop < c) if side == 1 else (stop > c)):
            return
        size = ctx.size_by_risk_pct(0.01, stop=stop, entry=c)
        if not ctx.gate("size_at_least_the_minimum", size > 0):
            return
        tp = c + side * p.target_r * abs(c - stop)
        if side == 1:
            ctx.buy(size=size, sl=stop, tp=tp, tag="macd_200ema_buy")
        else:
            ctx.sell(size=size, sl=stop, tp=tp, tag="macd_200ema_sell")

Your turn

Test the MACD + 200 EMA yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the MACD + 200 EMA strategy (MACD 12, 26, 9, stop-loss at the 10-candle swing, take-profit at 1.5R) on the Nasdaq 100, 4-hour chart.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 16 November 2026.