# Moving Average Convergence/Divergence (MACD)

The **MACD** is a momentum indicator derived from two exponential moving averages. It highlights trend strength, direction, and potential crossover signals. Each result row contains three values: the MACD line, the signal line, and the histogram (the difference between the two).

Use cases: momentum analysis, crossover signals, spotting overbought/oversold conditions, and confirming trend direction.

<div data-try-url="/v1/options/indicators/macd/O:NFLX260402C00075000/?timespan=day&limit=10"></div>

## Endpoint

```
GET /v1/options/indicators/macd/{ticker}
```

### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `ticker` | string | Yes | Full options ticker (for example `O:NFLX260402C00075000`). |

### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | string | No | Anchor time: `YYYY-MM-DD` or **millisecond** Unix timestamp. |
| `timestamp.gte` | string | No | Range lower bound (date or ms timestamp). |
| `timestamp.gt` | string | No | Strictly greater. |
| `timestamp.lte` | string | No | Range upper bound. |
| `timestamp.lt` | string | No | Strictly less. |
| `timespan` | string | No | Aggregate bar width: `minute`, `hour`, `day`, `week`, `month`, `quarter`, or `year`. |
| `adjusted` | boolean | No | Use split-adjusted aggregates when `true` (default). `false` uses non-adjusted bars. |
| `short_window` | integer | No | Short EMA length used for the MACD line (commonly `12`). |
| `long_window` | integer | No | Long EMA length used for the MACD line (commonly `26`). |
| `signal_window` | integer | No | Smoothing window for the signal line (commonly `9`). |
| `series_type` | string | No | Which aggregate field drives the calculation (commonly `close`). |
| `expand_underlying` | boolean | No | When `true`, `results.underlying` includes an `aggregates` array and a `url` for the matching [aggregates](/docs/aggregates) range. When `false` or omitted, `underlying` is omitted. |
| `order` | string | No | Sort order of points by timestamp (`asc` / `desc`). |
| `limit` | integer | No | Max points returned. Default **10**, maximum **1000**. |
| `page` | string | No | Pagination continuation: use the URL in `next_url`, or pass the `page` query value from that URL here. |

### Response

| Field | Type | Description |
| --- | --- | --- |
| `status` | string | Outcome (for example `OK`). |
| `request_id` | string | Unique identifier for this request, assigned by CuteMarkets. |
| `results` | object | Indicator payload. |
| `next_url` | string | When more values exist, full URL for the next page. |

Use `limit` and timestamp filters per page; follow `next_url` when present.

`results` contains:

| Field | Type | Description |
| --- | --- | --- |
| `values` | array | MACD data points: see fields below. |
| `underlying` | object | **Only when** you pass `expand_underlying=true`. Contains `aggregates` and `url`: an absolute URL to the same contract’s aggregates over the inferred date range (for example `https://api.cutemarkets.com/v1/options/aggs/{ticker}/1/day/{from}/{to}/`). |

Each object in `values` contains:

| Field | Type | Description |
| --- | --- | --- |
| `timestamp` | integer | Millisecond Unix timestamp of the bar. |
| `value` | number | MACD line (short EMA minus long EMA). |
| `signal` | number | Signal line (EMA of the MACD line). |
| `histogram` | number | `value` minus `signal`. |

### Example request

```bash
curl \
  "https://api.cutemarkets.com/v1/options/indicators/macd/O:NFLX260402C00075000/?timespan=day&short_window=12&long_window=26&signal_window=9&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Sample response

```json
{
  "results": {
    "values": [
      { "timestamp": 1775102400000, "value": 1.5792238252289934, "signal": 1.743386105515799, "histogram": -0.16416228028680568 },
      { "timestamp": 1775016000000, "value": 1.358035555688602,  "signal": 1.7844266755875005, "histogram": -0.42639111989889855 },
      { "timestamp": 1774929600000, "value": 1.2596020108470398, "signal": 1.8910244555622249, "histogram": -0.631422444715185 }
    ]
  },
  "status": "OK",
  "request_id": "cm_6b4abb381e65434da465c527122093d9"
}
```
