momentummedium-high risk

MACD Crossover Strategy (Crypto)

Does a MACD crossover strategy work on crypto? Backtested on real Hyperliquid perps from 2024-08-15 to 2026-07-05, the default settings earned a Sharpe of 1.83 — +274.9% total return with a 31.7% worst drawdown across 5,205 trades, net of fees, slippage, and funding.

By Keel Research · Data as of 2026-07-05 · how this backtest was produced
EquityDrawdown
Sharpe
1.83
default settings
Total return
+274.9%
Worst drawdown
−31.7%
Trades
5,205

2024-08-152026-07-05 · net of fees, slippage, and funding · price-only Sharpe 1.95 · 5,205 trades — the numbers already include that turnover cost.

At $1,000, this strategy’s worst historical dip was about $317. Free account, your own Hyperliquid keys — Keel only trades.

How it works

How it works

This strategy trades the top-15 Hyperliquid perpetuals on four-hour bars. It goes long a coin when its MACD histogram (12/26/9) turns positive — a confirmed shift in momentum — and its price is above its 200-bar average, which keeps entries on the trending side. Otherwise it holds cash. Positions are equal-weight, 1x gross, long-or-flat, and it trades only when a position drifts 20% from target.

When it works best

Sustained, multi-day trends — exactly the legs the four-hour timeframe is quick enough to catch. The timeframe is the whole edge here: the identical rules run on daily bars barely break even, because by the time a daily MACD confirms, crypto's move is largely over. The MACD periods themselves make little difference. Over 2024-08-15 to 2026-07-05 the default four-hour settings returned +274.9% with a Sharpe of 1.83 and a maximum drawdown of −31.7%, net of fees, slippage, and funding.

When it struggles

Choppy, directionless markets, where the trend filter flips on and off and each entry gives back a little. It is long-or-flat, so it sits out downtrends rather than profiting from them, and drawdowns can run deep — the test window saw a −31.7% maximum. At 5,205 trades over the window, turnover is meaningful, so fees matter.

How it’s built

The exact strategy behind this backtest — no black box. Switch to code to see or copy the full definition.

Configuration

Globalsconfig
target_timeframe4h
UniverseassetsTop by Volume · HL Perps · 15 assets
Executiontrading
rebalanceEvery Bar

Factories

trend_vs_200factory
Pipeline5 steps
PriceDataLoaderData Loader
timeframe15min
TargetTimeframeResamplerData Transform
Parallel2 branches
entries
Parallel2 branches
const
ConstantForecastForecast Mapper
value1
setup
Parallel2 branches
macd_up
MACDIndicator
fast_period12slow_period26signal_period9
AboveThresholdFilterSignal Transform
threshold0
uptrend
trend_vs_200call
AboveThresholdFilterSignal Transform
threshold0
MaskAndSignal Composer
ApplyMaskSignal Composer
score_signalconstfilter_signalsetup
macd_entrystore
exits
Parallel2 branches
const
ConstantForecastForecast Mapper
value1
cross_down
MACDIndicator
fast_period12slow_period26signal_period9
BelowThresholdFilterSignal Transform
threshold0
ApplyMaskSignal Composer
score_signalconstfilter_signalcross_down
macd_exitstore
PositionStateMachinePosition Manager
entry_slotmacd_entryexit_slotmacd_exit
EqualWeightSizerPosition Sizer
target_leverage1max_weight0.2

Explore the settings

precomputed · updates instantly

Adjust a setting to see the exact backtested result — including the ones that lost money.

MACD periods
tf
Universe size (top by volume)
Sharpe
1.83
Return
274.9%
Worst DD
−31.7%
Trades
5,205

Heads up: high turnover.

At $1,000, these settings' worst historical dip was about $317. You land in the editor with this exact setup. Free account, your own keys.

Compare all 5 settings
SettingsSharpeReturnWorst DDTrades
MACD 12/26/9 · tf 4h · Universe 15default1.83274.9%−31.7%5,205
MACD 8/17/9 · tf 4h · Universe 151.65214.9%−32.3%5,168
MACD 12/26/9 · tf 4h · Universe 251.20163.9%−48.9%9,500
MACD 12/26/9 · tf 4h · Universe 81.0564.5%−29.7%2,889
MACD 12/26/9 · tf 1d · Universe 15-0.10-13.1%−38.9%438

The data

Monthly returns

MonthReturn
2024-080.0%
2024-09+10.6%
2024-10+5.5%
2024-11+70.4%
2024-12-5.7%
2025-01-3.4%
2025-02-6.0%
2025-03-7.2%
2025-04+9.8%
2025-05+4.5%
2025-06+2.8%
2025-07+7.6%
2025-08-0.4%
2025-09+28.7%
2025-10-3.1%
2025-11-2.7%
2025-12+3.3%
2026-01+29.9%
2026-02+9.9%
2026-03-1.3%
2026-04-6.8%
2026-05+29.8%
2026-06-15.7%
2026-07+4.2%

Which assets it traded

Avg allocationDays held% of time heldAsset
0.1766100124.21HYPE
0.166499424.04BTC
0.159995623.13LINK
0.160591622.16ETH
0.16585920.78XRP
0.159279519.23DOGE
0.15978418.96SOL
0.157274718.07SUI
0.173969816.88VVV
0.154766316.04kPEPE
0.17741910.14ZEC
0.16173889.39PUMP
0.17132395.78XPL
0.17191854.48LIT
000GRAM

What this is: a historical backtest on real Hyperliquid market data, net of fees, slippage, and funding. Its worst historical drawdown was 31.7% — expect drawdowns of that order or worse. Past performance does not predict future results, and this is not investment advice. Size your account so a full drawdown is survivable.

Questions

Common questions

Does a MACD crossover strategy work on crypto?

Over 2024-08-15 → 2026-07-05 on real Hyperliquid perps, the default settings earned a Sharpe of 1.83 with +274.9% total return and a 31.7% worst drawdown across 5,205 trades — net of fees, slippage, and funding. Read the drawdown expectations before sizing your account.

Best MACD settings for crypto perps

You can adjust MACD periods, Signal timeframe, Universe size (top by volume). The config explorer on this page lets you compare every setting we tested — including the ones that underperformed — with the exact backtested result for each.

Related strategies