MACD Trend Following Backtest: Bar-Close Signals vs Next-Bar Execution
MACD signal-line crosses are confirmed at bar close. Trend rules hold for a long time, so execution differences matter less per trade — but not zero.
Short answer
A MACD trend rule (long when MACD closes above its signal line, exit on the reverse cross) has fewer, longer trades. Execution model differences per trade are small relative to trend gains, but intrabar crosses that reverse still add whipsaw trades. Compare intrabar, close and next-open execution; the main gain from realistic modelling is removing un-crossed intrabar signals.
Signal time vs execution time
| Execution model | Assumption | Net avg (illustrative) |
|---|---|---|
| Intrabar cross | Includes reversed crosses | +0.88% |
| Next bar open + slippage | Realistic | +0.79% |
| Signal bar close | Zero latency | +0.81% |
Where the difference comes from
With longer holds, the per-trade cost of a few basis points of execution is small; the bigger distortion is the extra whipsaw trades intrabar evaluation creates.
Break-even after realistic execution
| Item | Value (illustrative) |
|---|---|
| Trades | 70 |
| Gross avg per trade | +0.95% |
| Fees (2 × 0.05%) | −0.10% |
| Slippage (2 × 0.04%) | −0.08% |
| Net avg per trade | +0.77% |
| Break-even round-trip cost | 0.95% |
Related: MACD Crossover Before Candle Close: Why the Signal Can Vanish, Bollinger Band Mean Reversion Backtest: Bar-Close Signals vs Next-Bar Execution.
Test the macd trend following rule with next-bar fills in ChartsPod.
Open the ChartsPod terminalCompare intrabar, close and next-open execution; the main gain from realistic modelling is removing un-crossed intrabar signals.
Test MACD Trend Following Backtest on a perpetual chart; no account is needed to chart.
Launch ChartsPodQuestions readers ask
Does execution timing matter for trend rules?
Less per trade, but intrabar whipsaws still distort.
Which model?
Next bar open.
Where's the main gain?
Removing reversed intrabar crosses.
Sources and methodology
Backtest cost logic follows TradingView's Pine Script strategy documentation; indicator definitions are standard. All performance numbers are illustrative examples of the method, not results of real tests.
- TradingView Pine Script: Strategies — simulated fills and assumptions.
- TradingView Pine Script: Repainting — live vs historical calculation.
- ChartsPod documentation — guides for order flow, derivatives, alerts, backtests, journal and workspaces.
- TradingView Pine Script: Strategies — simulated fills and assumptions.
- TradingView Pine Script: Repainting — live vs historical calculation.
This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.
CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.