MACD Signal Crossover (Trend)

Buys when the MACD line (12/26) crosses above its 9-bar signal line and sells when it crosses back below.

How It Works

  1. Compute the MACD line — the 12-bar EMA minus the 26-bar EMA — and its signal line, a 9-bar EMA of the MACD itself.
  2. Buy when the MACD line crosses above its signal line: momentum has turned up faster than its own recent trend.
  3. Sell when the MACD line crosses back below the signal line.

Worked example. MACD has been recovering: yesterday −0.4 against a signal of −0.2, today +0.1 against −0.1. The line has crossed above its signal — buy. When MACD later drops back through the signal line, the position closes.

The Math Behind The Indicators

Everything runs on closing prices of the traded timeframe: P is a close, Pt today's close, and N counts bars — one bar is one candle of that timeframe, so 20 bars on a 1h chart is 20 hours.

Exponential Moving Average (EMA)
A running average that blends each new close into yesterday's value, so old prices fade away gradually instead of dropping out all at once. The blend factor α is larger for shorter periods, which makes short EMAs faster to react.
\[\mathrm{EMA}_t = \alpha \cdot P_t + (1 - \alpha) \cdot \mathrm{EMA}_{t-1}, \quad \alpha = \dfrac{2}{N + 1}\]
Example: With N = 19, α = 2 / 20 = 0.1. If yesterday's EMA was 100 and today's close is 110, the new EMA is 0.1·110 + 0.9·100 = 101 — it moves toward the new price but keeps most of its history.
MACD
The distance between a fast 12-bar EMA and a slow 26-bar EMA. When the fast average pulls above the slow one, MACD is positive and upward momentum is building. The signal line — a 9-bar EMA of the MACD itself — smooths it, so crossings between the two mark shifts in momentum.
\[\mathrm{MACD} = \mathrm{EMA}_{12} - \mathrm{EMA}_{26}, \quad \mathrm{Signal} = \mathrm{EMA}_9(\mathrm{MACD})\]
Example: If EMA12 = 105 and EMA26 = 102, MACD = +3: the recent trend runs above the longer one. With the signal line at 2.5, MACD sits above its signal — momentum is strengthening.

Example Chart

Example Chart

MACD Signal Crossover (Trend)

Real Data39/ 100Composite score

Metrics Per Trade

Metrics Per Trade

Real data · MACD Signal Crossover (Trend)

Final Metrics

Final Metrics

Real data · MACD Signal Crossover (Trend)

Scores

Scores

Real data · MACD Signal Crossover (Trend)

Resampled Data44/ 100Composite score

Metrics Per Trade

Metrics Per Trade

Resampled data · MACD Signal Crossover (Trend)

Final Metrics

Final Metrics

Resampled data · MACD Signal Crossover (Trend)

Scores

Scores

Resampled data · MACD Signal Crossover (Trend)