# A MACD strategy

> Build the MACD crossover for Bitcoin without code and backtest it on Binance candles since 2020: the rule, three settings, and how much the candle length matters.

Guide · Janorium · Published 2026-11-06  
Web page: https://janorium.com/guides/macd-strategy-backtest

A MACD strategy buys when the MACD line crosses above its signal line and sells when it crosses back. This recipe builds one for Bitcoin without code and tests it. On BTC since 2020 the length of the candles changed the result more than anything else: the same rule lost on 4-hour candles and made money on daily ones, and both trailed simply holding.

## The rule

MACD is the gap between a 12- and a 26-candle exponential average; its signal line is a 9-candle average of that gap. When the line crosses above its signal line, momentum has turned up.

- **Enter** when the MACD line crosses above the signal line, with half of the free capital.
- **Exit** when it crosses back below, or at a −6% loss, whichever comes first.

> **Idea: Follow MACD**
>
> Trades BTCUSDT on Binance spot, on daily candles.
>
> Buys when the MACD line (12, 26, 9) crosses above the MACD signal line (12, 26, 9), using 50% of the free capital.
>
> Closes the trade at a loss of −6%. It also closes when the MACD line (12, 26, 9) crosses below the MACD signal line (12, 26, 9).
>
> Every entry and every exit pays 0.1% in fees plus 0.01% slippage.
>
> BTCUSDT 1d, 2020-01-01 → 2026-11-01 · a dry run on past candles: Return +139.05%, max drawdown 24.60%, 90 trades, Buy & Hold +988.12%.
>
> [Open in the wizard](https://janorium.com/strategies/new?idea=macd&tf=1d&src=guide:macd-strategy-backtest)

*The recipe on daily candles, as the wizard builds it. The button opens the wizard with these answers.*

## Three steps

1. **Open it.** Press **Open in the wizard** on the card and check the answers: coin, direction and market, candles, which MACD, how much risk.
2. **Try it.** Press **Fine-tune in the editor**, then **Test on history**. Nothing is saved. Open the line under that button and tick **Compare against random entries** to see whether the cross beats a coin flip with the same exits.
3. **Keep it.** Save the strategy and press **Run backtest** on its page for the full report.

## What it did on Bitcoin

Dry runs on BTC from 2020-01-01 to 2026-11-01. Holding BTC over the same period made about +980%.

| Setting | Trades | Return | Max drawdown |
| --- | --- | --- | --- |
| 8/21/5 on 4-hour candles | 876 | about −45% | about 62% |
| 12/26/9 on 4-hour candles | 572 | about −7% | about 52% |
| 19/39/9 on 4-hour candles | 454 | about +43% | about 38% |
| 12/26/9 on daily candles | 90 | about +139% | about 25% |
| 12/26/9 on 4-hour candles, with the trend filter | 330 | about −2% | about 34% |
| 12/26/9 on 4-hour candles, the short mirror on futures | 573 | about −52% | about 61% |

Among the plain long settings, the fewer the trades, the better it went. Every round trip costs about 0.22% of the position, and a fast MACD flips back and forth on noise. The best row is still far behind holding, and it is the best of six on one coin, so run it elsewhere before believing it. [The study on ten coins](https://janorium.com/articles/macd-bollinger-bands-crypto-backtest) agrees: on daily candles the classic rule made money on 9 of 10 coins, holding did better on 7 of them, and on 4-hour candles costs took most of what it caught.

## What to try next

- **A filter.** In the wizard, **with the bigger trend** cut the 4-hour drawdown by a third here. [The trend-filter recipe](https://janorium.com/guides/trend-filter-trading-strategy) explains it.
- **An ATR stop.** In the editor, open **Quick add** in the exit section and pick **Stop by ATR**: the stop widens in wild markets and tightens in calm ones.
- **Another trend rule.** [The golden cross](https://janorium.com/articles/golden-cross-top-20-crypto-2020-2025) asks the same question of two moving averages.

## Frequently asked questions

### What are the best MACD settings for crypto?

There is no best setting in general. 12/26/9 is the classic and the place to start. On BTC in 2020–2026 slower settings and longer candles did better than faster ones, mostly because they trade less and pay less in costs.

### Does MACD work on Bitcoin?

It made money on daily candles and lost on 4-hour ones, and both trailed holding by a wide margin: about +139% and about −7% against about +980%. Against random entries it did better than the Bollinger bounce: [the study](https://janorium.com/articles/macd-bollinger-bands-crypto-backtest) has it ahead in 16 of 20 runs.

### Do I need to know how to code?

No. The wizard builds the strategy from your answers and the editor changes it with forms; underneath it is a JSON config, not code. Janorium is free, with no card.
