# Trend Indicators API
> Live trend and direction indicators that traders run to gauge whether a market is trending and which way, computed on demand from the OHLC candles you pass in — no key, no cache, nothing stored. The adx endpoint returns the ADX (Average Directional Index) with the +DI and -DI lines using Wilder's method, so you get both the strength of a trend (a reading above 25 signals a real trend) and its direction. The psar endpoint returns the Parabolic SAR — the trailing stop-and-reverse level that sits below price in an uptrend and above it in a downtrend, and flips when price crosses it — together with the current trend. The donchian endpoint returns the Donchian Channel: the highest high and lowest low over the lookback with the midline, and whether the last close has broken out of the channel. These indicators all need the full high, low and close, and they answer a different question than momentum oscillators, closes-only indicators or volatility tools: is there a trend, and which way is it going. Works for any market — forex, stocks, crypto or commodities. Computed locally and deterministically, so it is instant and private. Ideal for trend-following bots, breakout screeners, trailing-stop logic and trading dashboards. ADX needs 2 x period + 1 candles. Live, nothing stored. 3 compute endpoints. For RSI/MACD use a technical-indicators API; for Stochastic/CCI use an oscillators API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/trendindicators-api/..."
```

## Pricing
- **Free** (Free) — 4,250 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 86,500 calls/Mo, 6 req/s
- **Pro** ($23/Mo) — 448,000 calls/Mo, 18 req/s
- **Business** ($52/Mo) — 2,810,000 calls/Mo, 45 req/s

## Endpoints

### Trend

#### `GET /v1/adx` — ADX + DI direction

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close, comma-separated oldest first Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112,112:114:110:113,113:115:111:114,114:116:112:115,115:117:113:116,116:118:114:117,117:119:115:118,118:120:116:119,119:121:117:120,120:122:118:121,121:123:119:122`
- `period` (query, optional, string) — ADX period (default 14; needs 2 x period + 1 candles) Example: `14`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/trendindicators-api/v1/adx?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112%2C112%3A114%3A110%3A113%2C113%3A115%3A111%3A114%2C114%3A116%3A112%3A115%2C115%3A117%3A113%3A116%2C116%3A118%3A114%3A117%2C117%3A119%3A115%3A118%2C118%3A120%3A116%3A119%2C119%3A121%3A117%3A120%2C120%3A122%3A118%3A121%2C121%3A123%3A119%3A122&period=14"
```

**Response:**
```json
{
    "data": {
        "adx": 56.4677,
        "note": "ADX (Wilder) measures trend strength (>=25 trending); +DI vs -DI gives direction. Needs 2 x period + 1 candles.",
        "period": 14,
        "source": "TREND",
        "candles": 30,
        "plus_di": 23.8736,
        "minus_di": 3.5705,
        "direction": "bullish",
        "trend_strength": "very_strong"
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:03.943Z",
        "request_id": "c9f9252f-2dc8-4310-8b94-6e7a5d91a0f8"
    },
    "status": "ok",
    "message": "ADX computed",
    "success": true
}
```

#### `GET /v1/donchian` — Donchian Channel + breakout signal

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112,112:114:110:113,113:115:111:114,114:116:112:115,115:117:113:116,116:118:114:117,117:119:115:118,118:120:116:119,119:121:117:120,120:122:118:121,121:123:119:122`
- `period` (query, optional, string) — Lookback period (default 20) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/trendindicators-api/v1/donchian?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112%2C112%3A114%3A110%3A113%2C113%3A115%3A111%3A114%2C114%3A116%3A112%3A115%2C115%3A117%3A113%3A116%2C116%3A118%3A114%3A117%2C117%3A119%3A115%3A118%2C118%3A120%3A116%3A119%2C119%3A121%3A117%3A120%2C120%3A122%3A118%3A121%2C121%3A123%3A119%3A122&period=20"
```

**Response:**
```json
{
    "data": {
        "note": "Donchian Channel = highest high and lowest low over the period; middle is their average. position_pct is where the close sits in the channel.",
        "lower": 102,
        "upper": 123,
        "width": 21,
        "middle": 112.5,
        "period": 20,
        "signal": "inside_channel",
        "source": "TREND",
        "candles": 30,
        "last_close": 122,
        "position_pct": 95.2381
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:04.036Z",
        "request_id": "cc77ada6-0578-454c-8471-0bc1f033117f"
    },
    "status": "ok",
    "message": "Donchian channel computed",
    "success": true
}
```

#### `GET /v1/psar` — Parabolic SAR trailing stop + trend

**Parameters:**
- `candles` (query, required, string) — OHLC candles open:high:low:close Example: `100:102:99:101,101:104:100:103,103:105:101:102,102:104:100:101,101:103:99:100,100:103:99:102,102:105:101:104,104:106:102:103,103:105:101:104,104:107:103:106,106:108:104:105,105:107:103:104,104:106:102:105,105:108:104:107,107:109:105:106,106:108:104:107,107:110:106:109,109:111:107:110,110:112:108:111,111:113:109:112,112:114:110:113,113:115:111:114,114:116:112:115,115:117:113:116,116:118:114:117,117:119:115:118,118:120:116:119,119:121:117:120,120:122:118:121,121:123:119:122`
- `step` (query, optional, string) — Acceleration step (default 0.02) Example: `0.02`
- `max` (query, optional, string) — Max acceleration (default 0.2) Example: `0.2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/trendindicators-api/v1/psar?candles=100%3A102%3A99%3A101%2C101%3A104%3A100%3A103%2C103%3A105%3A101%3A102%2C102%3A104%3A100%3A101%2C101%3A103%3A99%3A100%2C100%3A103%3A99%3A102%2C102%3A105%3A101%3A104%2C104%3A106%3A102%3A103%2C103%3A105%3A101%3A104%2C104%3A107%3A103%3A106%2C106%3A108%3A104%3A105%2C105%3A107%3A103%3A104%2C104%3A106%3A102%3A105%2C105%3A108%3A104%3A107%2C107%3A109%3A105%3A106%2C106%3A108%3A104%3A107%2C107%3A110%3A106%3A109%2C109%3A111%3A107%3A110%2C110%3A112%3A108%3A111%2C111%3A113%3A109%3A112%2C112%3A114%3A110%3A113%2C113%3A115%3A111%3A114%2C114%3A116%3A112%3A115%2C115%3A117%3A113%3A116%2C116%3A118%3A114%3A117%2C117%3A119%3A115%3A118%2C118%3A120%3A116%3A119%2C119%3A121%3A117%3A120%2C120%3A122%3A118%3A121%2C121%3A123%3A119%3A122&step=0.02&max=0.2"
```

**Response:**
```json
{
    "data": {
        "sar": 117,
        "note": "Parabolic SAR is the stop-and-reverse trailing level. Trend up = SAR below price; a close crossing the SAR flips the trend.",
        "step": 0.02,
        "trend": "up",
        "max_af": 0.2,
        "source": "TREND",
        "candles": 30,
        "distance": 5,
        "last_close": 122
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:04.132Z",
        "request_id": "717f770e-93da-4d1f-a9ff-74e98784f945"
    },
    "status": "ok",
    "message": "Parabolic SAR computed",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/trendindicators-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "candles = open:high:low:close, comma-separated, oldest first. ADX needs 2 x period + 1 candles (period default 14); Donchian period defaults to 20; PSAR step 0.02 / max 0.2.",
        "source": "Computed in-process from caller-supplied OHLC candles (no upstream)",
        "service": "trendindicators-api",
        "endpoints": {
            "GET /v1/adx": "ADX + DI direction (candles=o:h:l:c,...&period=14).",
            "GET /v1/meta": "This document.",
            "GET /v1/psar": "Parabolic SAR trailing stop + trend (candles=o:h:l:c,...&step=0.02&max=0.2).",
            "GET /v1/donchian": "Donchian Channel + breakout signal (candles=o:h:l:c,...&period=20)."
        },
        "description": "Live trend and direction indicators computed on demand from OHLC candles. The adx endpoint returns the ADX with +DI and -DI (trend strength and direction, Wilder's method); the psar endpoint returns the Parabolic SAR trailing stop-and-reverse level and the trend; the donchian endpoint returns the Donchian Channel (highest high, lowest low, midline) with breakout signal. These need the full high/low/close and answer whether a market is trending and which way — distinct from momentum oscillators, closes-only indicators and volatility tools. Computed locally, nothing stored.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:04.190Z",
        "request_id": "2a8172d4-1b13-48f1-be25-cf1f946dbff5"
    },
    "status
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/trendindicators-api
OpenAPI spec: https://www.oanor.com/api/trendindicators-api/openapi.json
