# Moving Average Convergence Divergence (MACD)

> QuantNexus indicator page for MACD momentum analysis.

**Route**: `/quantnexus/indicators/macd/`

## What It Does

MACD compares two moving averages to measure momentum and trend direction. It is one of the most common crossover indicators in technical analysis.

## Formula

`MACD Line = EMA(fast) - EMA(slow)`

`Signal Line = EMA(MACD, signal)`

`Histogram = MACD - Signal`

## Parameters

- `period_me1` - default `12`
- `period_me2` - default `26`
- `period_signal` - default `9`
- `movav` - default `ExponentialMovingAverage`

## C++23 API

```cpp
#include <nonabt/indicators/macd.hpp>
auto macd = std::make_unique<nonabt::MACD>(data().close(), 12, 26, 9, "ExponentialMovingAverage");
```

## Common Usage

- Use MACD line crosses for entry timing.
- Use the signal line for confirmation.
- Use the histogram for momentum strength and divergence.

## Practical Pattern

Bullish MACD setups usually require the MACD line to cross above the signal line while price structure also supports the move.
