MACD: momentum from two averages
- Lesson 3 of 5
- Indicators
- steps
- 7
- metrics taught
- 3
- Your test
- Not taken yet
About this lesson
What you'll learn
MACD turns the gap between two moving averages into a line you can read. You'll build it one piece at a time and see what its crosses tell you and what they leave out.
The MACD line is the gap between two EMAs
MACD starts with two exponential averages of the close: a fast one (EMA 12) and a slow one (EMA 26). The MACD line is the fast one minus the slow one.
When the price climbs, the fast average pulls ahead and the line rises above zero. When the price falls, the line drops below zero. It's measured in dollars, so on BTC it often reads in the hundreds.
The signal line averages the MACD line
The signal line is a 9-period EMA of the MACD line itself. It's an average of an average, so it's smoother and runs a little behind.
Most MACD readings compare these two lines: which one is on top, and when one crosses the other.
The histogram is the gap between them
The histogram is the MACD line minus the signal line, drawn as one bar per candle. A bar above zero means the MACD line is above its signal. A bar below zero means it's under.
Growing bars mean momentum is picking up. Bars shrinking toward zero mean it's fading. Drag through the hours to see the subtraction.
Crosses: the histogram changes side
When the MACD line crosses above its signal, the histogram turns positive. That's a bullish cross, and a bot can watch for it with "MACD histogram at or above 0". The opposite is a bearish cross.
A cross only says momentum changed direction. Look where each dot lands on the price: some come before a real move, others just before the price turns back.
Above or below zero
A MACD line above zero means EMA 12 is above EMA 26: recent prices are higher than older ones, which is what an uptrend looks like. Below zero is the reverse.
Pick a side and see which hours it covers. The shaded hours on the price match where the MACD line sits.
Your turn: filter the crosses
These are the same hours of BTC. Each dot is a bullish cross, the moment the histogram turns positive.
Now add a second condition: MACD line at or above 0. Only the crosses inside the uptrend stay. Compare how many fire and how the price did eight hours later. Under the chart, the histogram condition runs on the live feed.
Test what you learned
Three quick questions, then a bot to build.
Read the strategy and set up a bot that follows it, with the direction and the conditions it names and no others. Passing depends on the build alone. Once it's right, the bot fires and you see what the market did next, which won't always go your way.
These lessons explain what each number measures. They are not trading advice, and the lesson charts use simulated data. Preview build: market data on this site is simulated.