MACD crosses on crude oil
Micro Crude Oil (MCL) · 15-minute bars · 2016 to 2026 · Momentum · MACD after Gerald Appel
No edge after costs: profit factor 0.93 out of sample.
- Profit factor, out of sample
- 0.93
- Average trade, out of sample
- −0.03R
- Win rate, out of sample
- 37%
- Trades, 10 years
- 3,591
- Max drawdown
- $42,535
- Pass odds, median plan
- 8.4%
Hypothetical results. These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
Abstract
We backtested the MACD signal-line cross rules on Micro Crude Oil (MCL) 15-minute bars from 2016-01-11 to 2026-10-30: 3,591 trades, with commission and a tick of slippage on every market and stop fill. In sample (to 2023-08-03) it made −0.04R per trade with a profit factor of 0.92; out of sample (from 2023-08-04) −0.03R per trade and 0.93 over 1,076 trades. 0 of the 16 parameter settings we tried were profitable out of sample. Sized at $250 of risk a trade, simulated 50K evaluations passed 3% to 13% of the time across 36 tracked plans.
1Hypothesis
Trade crude when MACD (12, 26) crosses its 9-bar signal line on 15-minute bars, exit on the opposite cross, stop 1.5 ATRs away.
If MACD crosses catch the start of intraday trends in crude, the trends should pay for the many crosses that whipsaw.
2Data
- Instrument
- Micro Crude Oil (MCL), traded on the CL price series (CL.v.0: the most traded contract, rolled on volume). CME Globex via Databento.
- Period
- 2016-01-11 to 2026-10-30: 2,791 sessions, 3,787,721 one-minute bars, built into 255,261 15-minute bars around the clock.
- Costs
- $0.75 commission a contract each way and 1 tick ($1.00) of slippage on every market and stop fill. Limit orders fill when price touches them; market orders fill at the next bar's open and stops at their price, each with one tick of slippage; when a bar touches both the stop and the target, the stop counts.
- Position size
- About $250 of risk a trade: micro contracts, rounded down, at least one. R is a trade's net P&L divided by its risk at entry.
- Out of sample
- The last 30% of weekdays: 2023-08-04 on (846 days), after 1,974 in-sample days. The rules were fixed before either side was run.
3Method
Our reading of the publicly described rules; the creator may trade it differently. The rules, exactly as the code runs them:
- MACD is the fast (12) bar EMA minus the slow (26) bar EMA of the 15-minute closes; its signal line is a 9-bar EMA of MACD. Bars run around the clock.
- Entry: when MACD closes above its signal line after being at or below it, buy at the next bar's open; when it closes below, sell. New entries from 09:30 to 14:00 ET.
- Stop: 1.5 times ATR(14) of the 15-minute bars from the fill.
- Target: target_r (2) times the risk.
- Exit: the stop, the target, the opposite cross (at the next bar's open), or flat at 14:30 ET.
- Size: about risk_usd dollars of risk a trade (micro contracts, rounded down, at least 1 and at most max_contracts).
"""MACD signal-line cross on Micro Crude Oil (MCL) 15-minute bars, New York time. Rules: 1. MACD is the `fast` (12) bar EMA minus the `slow` (26) bar EMA of the 15-minute closes; its signal line is a 9-bar EMA of MACD. Bars run around the clock. 2. Entry: when MACD closes above its signal line after being at or below it, buy at the next bar's open; when it closes below, sell. New entries from 09:30 to 14:00 ET. 3. Stop: 1.5 times ATR(14) of the 15-minute bars from the fill. 4. Target: `target_r` (2) times the risk. 5. Exit: the stop, the target, the opposite cross (at the next bar's open), or flat at 14:30 ET. 6. Size: about `risk_usd` dollars of risk a trade (micro contracts, rounded down, at least 1 and at most `max_contracts`)."""import qy def ready(*values): """True when every value is a number (indicators have no value until they have enough data).""" return all(v is not None and v == v for v in values) class Bot(qy.Strategy): """MACD crosses its signal line: trade the cross, exit on the next one.""" symbol = "MCL" timeframe = "15m" session = None params = {"fast": 12, "slow": 26, "target_r": 2.0, "risk_usd": 250, "max_contracts": 50} max_position = 50 entry_window = ("09:30", "14:00") flatten_time = "14:30" overnight = False def setup(self): self.macd_line, self.signal, _ = self.macd(self.close, self.p.fast, self.p.slow, 9) self.atr_line = self.atr(14) def _size(self, risk_points): per_contract = risk_points * self.point_value n = int(self.p.risk_usd // per_contract) if per_contract > 0 else 1 return max(1, min(self.p.max_contracts, n)) def on_bar(self, bar): if not ready(self.macd_line[0], self.signal[0], self.macd_line[1], self.signal[1], self.atr_line[0]): return up = self.crossed_above(self.macd_line, self.signal) down = self.crossed_below(self.macd_line, self.signal) if (self.position.is_long and down) or (self.position.is_short and up): self.close_position("opposite cross") return t = bar.dt.hour * 60 + bar.dt.minute + 15 if not self.position.is_flat or self.orders or not 570 <= t < 840: return atr = self.atr_line[0] f = atr / bar.close * 100 if up: self.buy(self._size(1.5 * atr), stop_atr=1.5, target_r=self.p.target_r, tag=f"MACD long | f={f:.4f}") elif down: self.sell(self._size(1.5 * atr), stop_atr=1.5, target_r=self.p.target_r, tag=f"MACD short | f={f:.4f}")4Results
| Statistic | In sample | Out of sample | All |
|---|---|---|---|
| Trades | 2,515 | 1,076 | 3,591 |
| Net P&L | −$24,778 | −$8,291 | −$33,069 |
| Profit factor | 0.92 | 0.93 | 0.92 |
| Average trade | −0.04R | −0.03R | −0.04R |
| 95% interval of the average | −0.09 to 0.00 | −0.10 to 0.04 | −0.08 to 0.00 |
| t-statistic of trade R | −1.81 | −0.91 | −2.02 |
| Win rate | 39% | 37% | 39% |
| Average win / average loss | 1.44 | 1.56 | 1.47 |
| Max drawdown | $33,688 | $17,204 | $42,535 |
| Sharpe ratio (daily, annualized) | −0.72 | −0.59 | −0.69 |
| Longest losing streak | 14 | 12 | 14 |
| Long / short profit factor | 0.96 / 0.88 | 0.93 / 0.94 | 0.95 / 0.90 |
| Average holding time | 86 min | 92 min | 88 min |
| Commission paid | $27,281 | $9,282 | $36,563 |
Drag across the chart to zoom into a period, double-click to reset.
Averages: −0.04R in sample, −0.03R out of sample.
1,600 of 3,591 points drawn; the fit and the means use all of them. Drag a box to zoom, double-click to reset.
5Robustness
We reran the strategy on a grid of 16 settings of its two main parameters, each on the full history with the same split. 0 were profitable in sample and 0 out of sample.
Fast EMA (bars) across, slow EMA (bars) up. Solid outline: the defaults we tested; dashed: the in-sample best.
Hover a cell for both sides of the split.
Fast EMA (bars) 6.00 to 16.0 across · Slow EMA (bars) 20.0 to 50.0 in depth · Profit factor, out of sample 0.87 to 0.96 as height and shade. Drag or use the arrow keys to turn it.
Drag to rotate; ctrl or ⌘ and scroll to zoom.
What would change it
Nothing on the grid helps. Its in-sample best, fast EMA (bars) 16 and slow EMA (bars) 50, had profit factor 0.95 in sample but 0.87 out of sample, against 0.93 for the defaults.
6Prop-firm implications
The backtest's sessions run through the rules of 36 tracked 50K evaluations: 2,000 runs of up to 60 sessions each, with the drawdown and daily limits checked against each trade's intraday low. Intervals are Wilson 95% intervals of the simulation. A simulation of the past, not the chance that anyone passes.
| Plan | Pass odds, 95% interval | Pass | Fail | Out of time | Median sessions |
|---|---|---|---|---|---|
| FundedNext Futures Flex Challenge 50K | 12.7% | 82% | 5% | 30 | |
| AquaFutures Beginner 50K Evaluation | 8.8% | 57% | 34% | 38.5 | |
| Bulenox 50K Qualification Account (Legacy, Option 2, EOD drawdown) | 8.8% | 57% | 34% | 38.5 | |
| Bulenox 50K Qualification Account (Legacy, Option 1, trailing drawdown) | 8.6% | 62% | 29% | 38 | |
| Alpha Futures Standard 50K Evaluation | 8.4% | 72% | 20% | 38 | |
| Alpha Futures Zero 50K Evaluation | 8.4% | 72% | 20% | 38 | |
| Apex Trader Funding 50K EOD Evaluation | 8.4% | 72% | 20% | 38 | |
| FTMO Futures Growth 50K Evaluation | 8.4% | 72% | 20% | 38 | |
| Funded Futures Family 50K Evaluation (standard plan) | 8.4% | 72% | 20% | 38 | |
| Funded Futures Network STEADY 50K Evaluation | 8.4% | 72% | 19% | 38 |
7Limitations
- Every cross is taken: no trend filter.
- One market (MCL).
- A backtest on the past, with fills simulated from one-minute bars; live fills, queues and outages differ.
8Conclusion
No edge after costs: profit factor 0.93 out of sample. Nothing on the grid helps. Its in-sample best, fast EMA (bars) 16 and slow EMA (bars) 50, had profit factor 0.95 in sample but 0.87 out of sample, against 0.93 for the defaults. On this reading of the rules, with these costs, the historical record gives no reason to expect a profit.
9References
- Appel, G. (2005). Technical Analysis: Power Tools for Active Investors. FT Prentice Hall.