MACD explained, and how to write it as a condition
MACD looks like a complicated indicator — three things drawn in one pane — and is built from the simplest one. It is two moving averages and the distance between them. Once you see that, every comparison on it makes sense.
The three parts
- The MACD line is the gap between a fast and a slow exponential moving average of price — a 12-period and a 26-period by default. When the fast average pulls away above the slow one the line rises; when they close back together it falls toward zero; when the fast average is below the slow one the line is negative.
- The signal line is a 9-period average of the MACD line, drawn beside it. It is the MACD line, smoothed and a little behind.
- The histogram is the gap between those two: positive when the MACD line is above its signal line, negative when below, growing as they separate.
The 12, 26, 9 are the three settings, and they are the defaults in SixOne8 as on most charts. Each is a count of bars of the timeframe the condition reads.
Why there are no levels
RSI lives on a 0–100 scale, so "RSI less than 30" means the same thing on every market. MACD is measured in price: the gap between two averages of EUR/USD is a fraction of a cent, the gap between two averages of Bitcoin is hundreds of dollars. A fixed level is meaningless across markets, which is why every MACD comparison is about sign and crossings rather than a number you type.
Writing it as a condition
- Above zero / below zero. Whether the fast average is above or below the slow one. A state, and the plainest trend description MACD offers.
- Crosses above zero / crosses below zero. The moment the two averages cross — the same event as an EMA crossover, seen from the MACD pane.
- Line crosses above its signal line / below its signal line. The MACD line moving through its own smoothed copy. This is the crossing people usually mean by "a MACD crossover", and it happens more often than the zero cross because it does not need the averages themselves to cross.
- Histogram rising / histogram falling. The two lines separating or converging bar over bar — the gap getting bigger or smaller, whichever side of zero it is on.
MACD(12, 26, 9) on 1h · line crosses above signal
MACD(12, 26, 9) on 4h · above zero
Those two together are a common shape: the 4-hour condition says the slower trend is up and stays true for long stretches; the 1-hour crossing is the moment that completes the strategy and fires the alert.
What it shares with a moving average
Everything, including the lag. MACD is built from averages of bars that have already closed, so a crossing confirms a change that has already started. If the moving averages guide made sense, MACD is the same idea with the distance between the averages made visible — and the histogram is a way of seeing that distance change before the lines themselves cross.
Divergence between MACD and price is a separate indicator in SixOne8 with its own comparisons, as it is for RSI.
Before you trust it
A MACD crossing on a fast timeframe happens constantly, and most of them lead nowhere in particular. Whether the ones your strategy would have fired on moved any differently from a random moment, on the market you care about, is what an entry check measures — and it measures the past.