EMA crossover strategy: 9/21 vs 50/200 and what holds up on futures
An EMA crossover strategy holds up on futures more often with a slow pair on daily bars than with a fast pair on intraday bars. The pair matters less than two checks: neighbouring settings must behave alike, and the result must stay positive after commission and slippage on data the search never saw.
By Soren Huang · Published · updated · Editorial policy
Contents
- Which EMA crossover settings hold up in a futures backtest?
- How does a fast and slow EMA crossover rule work?
- Is 9/21 or 50/200 the better EMA pair?
- Is an EMA crossover better than an SMA crossover?
- Does an EMA crossover get whipsawed, and what do costs do to it?
- What does an NQ daily-bar backtest of a trend rule show?
- Do the best EMA settings differ by market?
- Frequently asked questions
- References
Which EMA crossover settings hold up in a futures backtest?
An EMA crossover strategy holds up on futures more often with a slow pair on daily bars, such as 50/200, than with a fast pair on intraday bars, such as 9/21. The pair itself matters less than two checks: neighbouring settings must behave alike, and the result must stay positive after commission and slippage on out-of-sample data.
"Holds up" has a plain meaning here. A setting holds up when its average trade after costs is still positive on data that did not help choose it, and when the settings next to it (8/20, 10/22) give a similar result. A pair that only works at one exact value, or only before costs, has described the noise of one history. That is the claim this article defends: the choice between 9/21 and 50/200 is the smaller decision; the plateau test and the cost test decide whether either one is worth trading. The same two tests apply to every rule in the guide to technical analysis tools and indicators you can test; the crossover is simply the one where the cost test bites hardest.
Research on moving-average rules points the same way. Brock, Lakonishok and LeBaron (1992) found that moving-average rules showed predictive patterns on about ninety years of Dow index data before transaction costs. Sullivan, Timmermann and White (1999) retested the same family of rules while correcting for the number of rules tried and found that on the ten years that followed, the best rule no longer outperformed. Park and Irwin (2007) surveyed the later studies and list the same two weak points: costs left out and too many variants compared on one history.
How does a fast and slow EMA crossover rule work?
The rule is long when the fast EMA is above the slow EMA and short or flat when it is below, with the signal read at the bar close and the fill taken on the next bar. An exponential moving average (EMA) is an average of recent closes that gives more weight to the newest close and less to older ones; the moving averages indicator page covers the calculation. A crossover rule is a rule that changes position when a short-length average crosses a long-length average.
The order of events inside one signal matters, because it decides which price the backtest is allowed to use:
- At the close of a bar, both EMAs are updated with that close.
- If the fast EMA has moved from below to above the slow EMA, the rule records a buy signal. The reverse cross records a sell signal.
- On the open of the next bar, the order is filled. The close that produced the signal is not a price you could have traded at, because the signal did not exist until that bar ended.
- The position stays open until the opposite cross. A long-and-short rule reverses; a long-only rule goes flat.
Lag is the number of bars between the price turning and the cross confirming the turn. It is built into the rule: the averages must be pulled through each other, and that takes several bars after the actual high or low. A crossover is therefore a late entry by design, unlike bullish and bearish candlestick patterns in a backtest, which fire on one or two bars. The crossover pays for its lateness with fewer, longer trades; whether that trade is a good one is what the rest of the article tests.
Is 9/21 or 50/200 the better EMA pair?
Neither pair is better in general; each fails in a different way, and only a parameter plateau tells you which one is not a lucky spike on your market. 9/21 trades many times with a small move per trade, so it is the first to fail when costs are added. 50/200 trades a few times a year with large moves and large givebacks, so a handful of trades decide the whole result and the sample stays small. 20/50 sits between them.
| Pair (daily bars) | Crosses per year | Lag at trend start | Giveback at trend end | Sensitivity to costs |
|---|---|---|---|---|
| 9/21 | Many | Short | Small | High |
| 20/50 | Medium | Medium | Medium | Medium |
| 50/200 | Few | Long | Large | Low |
A parameter plateau is a region of neighbouring settings that all give a similar net result. Think of a hill: a plateau is a broad flat top where a step in any direction changes little; a spike is a needle where one step off the top drops you to the valley. When you test fast lengths 8 to 12 against slow lengths 18 to 24 and only 9/21 is good, the 9/21 result is the needle. The market did not reward "9 and 21"; it rewarded one accident of that history. The method for reading such a grid is covered in parameter stability: plateau or lucky spike.
The same grid test is why fast pairs on intraday bars rarely pass. On 5-minute bars the move captured per cross is a few ticks, so the plateau that exists before costs often disappears after them, which is the pattern described in what testing shows about the best indicator for intraday trading. A slow pair on daily bars keeps its plateau more often because each trade captures a move many times the round-trip cost. Its problem is the opposite one: few trades, so the out-of-sample sample must be measured in years.
Is an EMA crossover better than an SMA crossover?
An EMA crossover is earlier, not better: it enters trends sooner and also produces more false crosses than an SMA crossover of the same lengths. A simple moving average (SMA) is the plain average of the last N closes, every close counting the same. The EMA counts the newest close most and each older close a little less, so it bends toward a price turn before the SMA does.
An everyday comparison: an SMA grades a student by averaging all tests equally; an EMA gives the latest test the most weight. The EMA notices a change in form sooner, and it also overreacts to one bad day. The one formula worth knowing is how the weight is set:
EMA today = α × close today + (1 − α) × EMA yesterday, with α = 2 ÷ (N + 1)
Here N is the chosen length, α (alpha) is the share of today's close in the new average, and 1 − α is the share carried over from yesterday's EMA. For N = 21, α is about 0.09, so today's close gets about 9 percent of the weight and the rest decays over the older bars.
| Property | EMA crossover | SMA crossover |
|---|---|---|
| Weight on the newest close | Largest, decaying backwards | Equal for every close |
| Cross at a trend start | A few bars earlier | A few bars later |
| False crosses in a sideways stretch | More | Fewer |
| Giveback at a trend end | Smaller | Larger |
| Best lengths | Must be found by its own grid | Must be found by its own grid |
So the choice is a trade of lag against whipsaw. Variants that cut lag further, such as the DEMA, the double exponential moving average, push the same trade further in the same direction: earlier crosses, more of them. None of them removes the cost of a false cross; they only change how many you pay for. The honest comparison is to run both crossovers through the same grid, with the same costs, and compare their plateaus, not their best single cells.
Does an EMA crossover get whipsawed, and what do costs do to it?
Yes: in a sideways market the two lines cross repeatedly, and each cross is a paid round trip, so the backtest must include commission and slippage from the first run and the pair must be graded out-of-sample with a rule written before you look. Whipsaw is a sequence of crosses in which each new position is closed at a small loss by the next cross before any trend develops. A thermostat set to one exact temperature behaves the same way: when the room hovers at the threshold, the heating switches on and off every few minutes, and every switch costs something.
Costs decide the fast pair because they are the same size on every trade while the gross move per trade is not. A fixed cost takes a large share of a small move and a small share of a large one.
Hypothetical example
Suppose a round trip costs $30 in commission and slippage on a micro index contract. A fast pair makes 80 crosses a year with a gross average trade of $40; after costs its average trade is $10, and a small rise in slippage makes it negative. A slow pair makes 3 crosses a year with a gross average trade of $900; after the same $30 its average trade is $870, almost unchanged. The slow pair's weakness is elsewhere: 3 trades a year means ten years give 30 trades, too few to judge the average on their own.
Two settings put costs where they belong. First, charge commission and at least one tick of slippage per side inside every evaluation, not after the search, so the ranking never favours the smoothest high-count pair; commission, slippage and the average trade in backtests explains how to set the numbers. Second, write the out-of-sample rule down before the run:
- Split the history by date and choose the pair on the earlier part only.
- Decide the pass line in advance, for example: the out-of-sample average trade after costs stays positive and at least a third of the in-sample figure, and at least four of the six neighbouring pairs also stay positive.
- Run the chosen pair unchanged on the later part and read it against that line.
- Accept or reject. Changing the lengths after a soft result turns the later part into in-sample data.
Bailey, Borwein, López de Prado and Zhu (2014) show why the pre-written line is needed: the more pairs you compare on one history, the more the best of them is inflated, and the inflation does not carry into new data. When the thresholds are set in AlphaPrime (Valynox) strategy validation before the search starts, the pass line for the walk-forward and out-of-sample steps is fixed by you in advance, and a crossover pair that fails an early check is dropped before it reaches the later data.
What does an NQ daily-bar backtest of a trend rule show?
The run below shows what a long-horizon trend rule looks like on NQ daily bars after costs: few trades, long holding times, a large drawdown relative to the yearly gain, and a result that depends on a handful of big trends. It did not test an EMA crossover itself. It used a Momentum rule, a stand-in trend rule built from the standard Momentum indicator, as its only entry and exit, with no stop, target or filter. The search tried 1,024 candidates on NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, and kept one of them for its return against its drawdown. The numbers are that kept candidate's.
Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $249,575 |
| Max drawdown | $93,215 |
| Trades | 60 |
| Win rate | 60% |
| Profit factor | 1.828 |
| Average trade | $4,159.58 |
| Time in market | 92.48% |
Read it as a shape, not a promise. Sixty trades over about six and a half years is fewer than ten a year, and the rule was in the market 92.48% of the time, which is what a slow trend rule does: it is almost always positioned and it reverses rarely. A max drawdown of $93,215 against a net profit of $249,575 says that more than a third of the whole gain was given back at least once, the "large giveback" from the pairs table. The profit factor of 1.828 and the win rate of 60% come from 60 trades, a sample in which replacing three or four trades would move both figures noticeably.
Two things flatter these numbers. The candidate was picked after the fact as the best of 1,024 by return against drawdown, so part of what it shows is selection, exactly the inflation the previous section described. And the stand-in rule is not the EMA crossover you would trade. Neither the Momentum rule nor any EMA pair earned this money in a sense a reader can expect to repeat; the run shows the character of a daily trend rule on this market after $30 of costs per trade, and that character is what an EMA crossover test on NQ daily bars should be compared against.
Do the best EMA settings differ by market?
Yes: index futures, gold, crude oil and TAIEX futures trend for different lengths of time and carry different costs relative to their daily range, so a pair that reaches a plateau on NQ must be tested again on each market rather than copied across. A moving-average length is a bet on how long a move persists. A market whose moves run for months rewards long lengths; a market whose moves reverse within days punishes them with giveback and rewards shorter ones, if the costs allow.
Two numbers describe a market for this purpose, and both are measured on your own data rather than assumed:
- Trend persistence: how many bars a move typically runs before it reverses by more than its usual daily swing. Longer persistence favours slower pairs.
- Round-trip cost relative to daily range: commission plus slippage in points, divided by the average daily range in points. The smaller this share, the shorter a pair can go before costs eat the average trade.
| Market | Trend persistence (starting hypothesis) | Round-trip cost ÷ daily range (starting hypothesis) | Test to run |
|---|---|---|---|
| NQ | Long | Low | Daily plateau check first; intraday pairs only if a daily pair survives |
| ES | Long | Low | Same order; expect slower pairs than NQ to look alike |
| GC (gold) | Medium | Medium | Daily plateau check; rerun with doubled slippage |
| CL (crude oil) | Short to medium | Medium | Daily plateau check; expect more whipsaw than index futures |
| TAIEX futures | Medium | Check on your own data | Daily plateau check on day-session and full-session bars separately |
The labels in the table are a starting hypothesis to confirm, not a finding. The order of tests is the part that transfers: run the daily grid with costs on each market, look for a plateau, grade the plateau's centre out-of-sample against your pre-written line, and only then try an intraday pair on the markets where the daily pair survived. Exchanges change tick sizes, fees and session hours from time to time, so take the cost inputs from the exchange's contract page for the market you test, and check them again before a live test.
The next step is one grid. Take the market you trade, daily bars, fast lengths 8 to 60 and slow lengths 20 to 240 in steps, with your real commission and one tick of slippage per side, and write down the pass line before you press run. Then look for the flat region, not the dark cell.
Frequently asked questions
What is the best EMA setting for day trading futures?
There is no setting that holds up across markets, and fast pairs on intraday bars are the most likely to fail after costs because each cross captures only a few ticks. Test the pair you have in mind on a grid of neighbouring lengths with commission and slippage included, and keep it only if the neighbours behave alike and the out-of-sample average trade stays positive. If no plateau appears on intraday bars, test the same rule on daily bars before giving up on it.
Should I enter at the cross or wait for the bar to close?
Read the signal at the bar close and fill on the next bar. The two averages are only final when the bar has closed, so an entry at the close itself uses a price that did not exist when the decision was made. Backtests that fill on the signal bar's close look better than any live account can, and the difference grows with faster pairs.
Can a filter stop the EMA crossover from being whipsawed?
A filter such as a minimum distance between the averages, a volatility band or a higher-timeframe trend condition reduces the number of crosses taken in a sideways stretch. It also delays or skips some real trend entries and adds parameters that can be curve fitted. Treat the filtered rule as a new candidate: test its neighbours and grade it on data the filter's settings never saw, following the split described in in-sample vs out-of-sample.
How many trades does a 50/200 EMA crossover produce?
On daily bars a 50/200 pair crosses a few times a year on most futures markets, often fewer. That means ten years of history may hold only a few dozen completed trades, too few for the average trade to be stable on its own. Judge such a pair across several markets and with the sign of each out-of-sample window, rather than from one market's total.
References
- Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. The Journal of Finance, 47(5), 1731–1764.
- Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. The Journal of Finance, 54(5), 1647–1691.
- Park, C.-H., & Irwin, S. H. (2007). What Do We Know About the Profitability of Technical Analysis? Journal of Economic Surveys, 21(4), 786–826.
- Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.

