BACKTESTING · MACD TREND FOLLOWING EXECUTION

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 modelAssumptionNet avg (illustrative)
Intrabar crossIncludes reversed crosses+0.88%
Next bar open + slippageRealistic+0.79%
Signal bar closeZero latency+0.81%
Macd Trend Following: net avg by execution model (%)Macd Trend Following: net avg by execution model (%): Intrabar cross +0.88 %; Next bar open + slippage +0.79 %; Signal bar close +0.81 %.MACD TREND FOLLOWING: NET AVG BY EXECUTION MODEL (%)Intrabar cross+0.88 %Next bar open + slippage+0.79 %Signal bar close+0.81 %
Only next-bar or later is tradable. Original ChartsPod editorial graphic.

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.

Macd Trend Following: one signal (illustrative)Macd Trend Following: one signal (illustrative): BAR t: Signal forms intrabar; BAR t CLOSE: Signal confirmed; BAR t+1 OPEN: Realistic fill; COST: Gap + fees + slippage.BAR tSignal forms intrabarBAR t CLOSESignal confirmedBAR t+1 OPENRealistic fillCOSTGap + fees + slippage
The open can be far from the close. Original ChartsPod editorial graphic.

Break-even after realistic execution

ItemValue (illustrative)
Trades70
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 cost0.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 terminal

Compare 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 ChartsPod

Questions 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.

  1. TradingView Pine Script: Strategies — simulated fills and assumptions.
  2. TradingView Pine Script: Repainting — live vs historical calculation.
  3. ChartsPod documentation — guides for order flow, derivatives, alerts, backtests, journal and workspaces.
  4. TradingView Pine Script: Strategies — simulated fills and assumptions.
  5. 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.