MACD (Moving Average Convergence Divergence) tracks the relationship between two EMAs of price. It helps identify momentum shifts and trend changes.
Components
| Line | Meaning |
|---|---|
| MACD line | Fast EMA minus slow EMA |
| Signal line | EMA of the MACD line |
| Histogram | MACD line minus signal line |
Formula
MACD line = EMA_fast(close) − EMA_slow(close)
Signal line = EMA_signal(MACD line)
Histogram = MACD line − Signal line
Defaults on dogabot: fast 12, slow 26, signal 9.
Typical settings
Defaults on dogabot match widely used values:
- Fast EMA: 12
- Slow EMA: 26
- Signal EMA: 9
How traders interpret MACD
- Histogram above zero — Short-term momentum favors bulls relative to the signal smoothing.
- Histogram below zero — Momentum favors bears.
- Crossovers — Some strategies trade MACD crossing the signal line; others focus on zero-line crosses.
In dogabot
The MACD trading rule uses the histogram sign, not a MACD/signal line crossover:
- Buy when histogram > 0
- Sell when histogram < 0
This matches the Go evaluator used in backtests and live automations.
Example
Using defaults (12 / 26 / 9) on ETH/USDT 1h, the MACD histogram moves from −5 to +2 on the last bar. The MACD rule sees a positive histogram and may signal buy. A drop from +3 to −1 would flip toward sell.