Backtest the MACD Cross strategy on real crypto candles

The MACD Cross strategy trades momentum shifts: it goes long when the MACD line (EMA 12 minus EMA 26, here named DIF) crosses above its 9-period signal EMA (DEA), and exits when the lines cross back down. Compared with raw moving-average crosses, the extra EMA layer smooths entries slightly and reacts to momentum rather than price level.

This page loads the full rule into the backtester with DIF and DEA drawn beneath the price chart. The simulator fills at the next bar's open, applies your fees and slippage, and outputs the equity curve, Sharpe/Sortino, max drawdown, profit factor and trade-by-trade list — all computed locally in your browser.

How it works

  1. Pick a trading pair, interval and number of bars.
  2. The strategy ENTRY/EXIT formulas load into the editor, fully editable.
  3. Set fees, slippage and optional stop-loss / take-profit.
  4. Run the simulation and inspect the equity curve, Sharpe/Sortino, drawdown and trade list.

Frequently asked questions

What are the exact entry and exit rules of this MACD backtest?

ENTRY fires when DIF = EMA(C,12) − EMA(C,26) crosses above DEA = EMA(DIF,9); EXIT fires on the opposite cross. Fills happen at the next bar's open, and fees and slippage are configurable, so the reported metrics reflect tradable, not theoretical, performance.

How does the MACD cross differ from the MA 5/20 cross?

MACD crosses are smoothed twice (EMA difference, then EMA of that), so signals arrive a bit later but with fewer whipsaws than a fast 5/20 price-average cross. Whether that trade-off pays off is pair- and interval-specific — you can backtest both presets here in seconds and compare.

More strategy backtester pages

MA Cross 5/20 · RSI 30/70 · Bollinger Breakout · KDJ Cross · Donchian 20/10 · Trend Dip · Capitulation Reversal · Net Flow Trend · Trend Ignition

Related tools

MACD in the Indicator Lab