Guides/Compute Technical Indicators

    Guides

    Compute Technical Indicators

    The technicals endpoints compute any of 80+ indicators (moving averages, oscillators, volatility and volume studies, regressions, Hilbert-transform cycles) for a list of tickers, on scanr.ai's own price history. You send tickers and parameters; you never send price data.

    Use them to show why a stock matched a scan, to feed a model, or to chart studies without running your own TA library.

    You'll need: a Power User or Business token.

    One indicator

    Each indicator has its own endpoint, POST /api/v2/technicals/technical/{category}/{name}. RSI is momentum/rsi:

    bash
    curl https://scanr.ai/api/v2/technicals/technical/momentum/rsi \  -H "Authorization: Bearer $SCANR_API_TOKEN" \  -H "Content-Type: application/json" \  -d '{"tickers": ["AAPL", "MSFT", "NVDA"], "timeframe": "1d", "params": {"period": 14}}'
    json
    {  "indicator": "rsi",  "outputs": ["rsi"],  "results": [    { "ticker": "AAPL", "values": { "rsi": 58.4 } },    { "ticker": "MSFT", "values": { "rsi": 61.9 } },    { "ticker": "NVDA", "values": { "rsi": 71.2 } }  ],  "count": 3}

    The request

    FieldMeaning
    tickersOne or more tickers.
    timeframe1m … 4hr, 1d, 2d, 3d, 4d, 1wk, 1mo, the same values as scans.
    paramsThe indicator's integer parameters, lower-case: period, fastperiod, slowperiod, signalperiod, nbdevup, … Omitted parameters use their defaults.
    enum_paramsMoving-average types for studies that take them: {"matype": "EMA"}. One of SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, MAMA, T3.
    within1 (the default) returns the latest value. A larger number returns that many trailing values as a series, oldest first.
    limit_barsFeed the study more history than its default lookback, for slow studies that need warming up.
    include_inactiveInclude delisted or inactive tickers.

    Values always end at the latest bar, which during market hours is the in-progress one. There is no date range.

    Multi-output indicators

    Some indicators produce several lines; outputs names them. MACD returns macd, macdsignal and macdhist; Bollinger Bands return upperband, middleband and lowerband. With within, each output becomes a series:

    bash
    curl https://scanr.ai/api/v2/technicals/technical/momentum/macd \  -H "Authorization: Bearer $SCANR_API_TOKEN" \  -H "Content-Type: application/json" \  -d '{"tickers": ["NVDA"], "timeframe": "1d", "within": 5}'
    json
    {  "indicator": "macd",  "outputs": ["macd", "macdsignal", "macdhist"],  "results": [    {      "ticker": "NVDA",      "series": {        "macd": [3.1, 3.4, 3.9, 4.2, 4.6],        "macdsignal": [2.8, 2.9, 3.1, 3.3, 3.6],        "macdhist": [0.3, 0.5, 0.8, 0.9, 1.0]      }    }  ],  "count": 1}

    A value is null where the study hasn't warmed up yet (for example, the first 13 bars of a 14-period RSI when the ticker has little history).

    Many indicators at once

    POST /api/v2/technicals/technical/bulk computes a set of indicators over the same tickers and timeframe in one request, from one fetch of price history. Name each result with a key:

    bash
    curl https://scanr.ai/api/v2/technicals/technical/bulk \  -H "Authorization: Bearer $SCANR_API_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "tickers": ["NVDA", "AMD", "AVGO"],    "timeframe": "1d",    "indicators": [      { "indicator": "sma", "key": "sma50", "params": { "period": 50 } },      { "indicator": "sma", "key": "sma200", "params": { "period": 200 } },      { "indicator": "rsi", "params": { "period": 14 }, "within": 10 },      { "indicator": "atr", "params": { "period": 14 } },      { "indicator": "bbands", "params": { "period": 20 }, "enum_params": { "matype": "EMA" } }    ]  }'

    Each ticker's indicators map holds one entry per key (a key defaults to the indicator's name, so two sma entries need their own keys). Single-line indicators name their output line. If a requested indicator can't be computed for your plan, it's listed under excluded with the reason, and the rest are still returned.

    Indicators and scans together

    The same studies are scan filters, so the two endpoints divide the work:

    1. Scan to find the stocks that meet a condition across the whole market (for example, RSI(14) below 30).
    2. Compute indicators for the matches to rank or explain them (the exact RSI, distance from the 200-day average, ATR for position sizing).

    One scan plus one bulk call covers any number of matches, which is far cheaper than computing indicators for every stock and filtering them yourself.

    The names differ between the two

    Scan payloads use the catalog's spelling: "Technical": {"RSI": [{"Params": {"Period": {"Value": 14}}}]}, with capitalized names and {"Value": n} wrappers. The technicals endpoints use lower-case slugs and plain numbers: /momentum/rsi with {"params": {"period": 14}}. Output names differ too: RSI in a scan's Want, rsi here; Signal there, macdsignal here.

    The indicator list

    CategoryExamples
    overlapsma, ema, wma, dema, tema, kama, t3, bbands, sar, midpoint
    momentumrsi, macd, stoch, stochrsi, adx, cci, mfi, roc, willr, aroon, ultosc
    volatilityatr, natr, trange, adr, squeeze
    volumeobv, ad, adosc, relvol-stddev, relvol-directional
    statisticlinearreg, linearreg-slope, stddev, beta, correl, tsf
    cycleht-dcperiod, ht-sine, ht-trendmode
    priceavgprice, medprice, typprice, wclprice
    math_omax, min, sum, minmax

    Every endpoint, with its parameters, defaults and outputs, is under Technical Indicators in the API Reference.

    Next