Noon Barbari
Sign up

Back to strategy library

ConfluenceLong only1h4h1d

MACD trend with ADX strength filter strategy

Take MACD long crossovers only when ADX confirms a trend actually exists.

Thesis

Take MACD long crossovers only when ADX confirms a trend actually exists.

Fits Confluence setups — works best when the underlying market behavior matches the thesis, and breaks down when it doesn't. Pair with the backtester's walk-forward mode before committing real capital.

Trades less frequently than vanilla MACD because the ADX gate sits open only in directional regimes. Equity curve is flatter through chop and adds when a sustained trend kicks in.

YAML rule-set

Paste this into the Strategy Designer's Text tab, or use the dashboard button above to load it as a template.

name: macd_with_adx_strength
weight: 1.0
long_only: true
indicators:
  macd: {kind: macd, fast: 12, slow: 26, signal: 9}
  adx14: {kind: adx, period: 14}
entry:
  combine: AND
  rules:
    - {lhs: {indicator: macd, field: line}, op: crosses_up, rhs: {indicator: macd, field: signal}}
    - {lhs: {indicator: adx14, field: adx}, op: gt, rhs: {value: 20.0}}
exit:
  combine: OR
  rules:
    - {lhs: {indicator: macd, field: line}, op: crosses_down, rhs: {indicator: macd, field: signal}}
risk:
  stop_loss_pct: 0.04
  trailing_stop_pct: 0.03
  cooldown_bars: 3

Indicators

  • macdMACD (12 / 26 / 9)

    EMA(12) minus EMA(26) with an EMA(9) signal smoother. Captures momentum direction and acceleration.

  • adx14ADX (period 14)

    Average Directional Index — a 0-100 gauge of trend strength regardless of direction. Readings above 20 are conventionally treated as 'there is a trend to ride'.

Entry conditions

The bot opens a position the bar after every condition below has fired.

  • MACD line crosses above signal AND
  • ADX(14) is above 20 — there's a real trend, not just chop.

Exit conditions

Any of the conditions below will close the position.

  • MACD line crosses below signal.
  • Hard 4% stop; 3% trailing stop locks in winners.

Expected behavior

Trades less frequently than vanilla MACD because the ADX gate sits open only in directional regimes. Equity curve is flatter through chop and adds when a sustained trend kicks in.

Equity-curve character, not a return forecast. Backtests are not promises about live performance.

Try it on your own data

Open the template in the dashboard to backtest it on BTC, ETH, or any CCXT symbol — or copy the YAML into the Strategy Designer to edit it first.

Past behavior on backtests is not a guarantee of future performance. Markets change; rule sets need re-validation. Trade at your own risk.