GET /v1/indicators/sma/{ticker}

Simple Moving Average (SMA)

Retrieve the Simple Moving Average (SMA) for a specified ticker over a defined time range. The SMA calculates the average price across a set number of periods, smoothing price fluctuations to reveal underlying trends and potential signals.

Endpoint Details

HTTP Method GET
Path /v1/indicators/sma/{ticker}
Version v1
Minimum Plan free

Path Parameters

Parameter Required Description Example
ticker Required The stock ticker symbol (e.g., AAPL, MSFT) AAPL

Query Parameters

Parameter Type Required Description
api_key string Required Your API key for authentication
timestamp string Optional Query by timestamp (YYYY-MM-DD or millisecond timestamp)
timespan string Optional Size of the aggregate time window (minute, hour, day, week, month, quarter, year)
adjusted boolean Optional Whether aggregates are adjusted for splits (default: true)
window integer Optional Window size for the indicator calculation
series_type string Optional Price type to use (close, open, high, low)
limit integer Optional Maximum number of results (default: 10, max: 5000)
order string Optional Sort order (asc or desc, default: asc)

Example Request

curl "https://mail.tradeiqai.com/api/v1/indicators/sma/AAPL?api_key=YOUR_API_KEY"

Note: Replace YOUR_API_KEY with your actual API key.

Response Attributes

Attribute Type Description
okbooleanIndicates if the request was successful (e.g., 1)
dataobjectResponse data object
data.statusstringResponse status (typically "OK") (e.g., OK)
data.request_idstringUnique identifier for the request (e.g., bb3f5e7e9ee61f2ed71753c9dd38384d)
data.resultsobjectArray or object containing the endpoint-specific data
data.results.underlyingobject
data.results.underlying.propertiesunknown
data.results.valuesarrayArray of objects
Array items contain:
data.results.values[].timestampintegerInteger (e.g., 1069218000000)
data.results.values[].valuedoubleFloating point number (e.g., 0.40083)
data.next_urlstringURL for pagination to fetch the next page of results (e.g., https://api.tradeiqai.com/v1/indicators/sma/AAPL?c...)

Example Response

{
    "ok": true,
    "data": {
        "status": "OK",
        "request_id": "bb3f5e7e9ee61f2ed71753c9dd38384d",
        "results": {
            "underlying": {
                "url": "https://api.tradeiqai.com/v2/aggs/ticker/AAPL/range/1/day/1063281600000/1770834393494?limit=235&sort=asc"
            },
            "values": [
                {
                    "timestamp": 1069218000000,
                    "value": 0.400829999999999964099828275720938108861446380615234375
                },
                {
                    "timestamp": 1069304400000,
                    "value": 0.4000500000000000166977542903623543679714202880859375
                },
                {
                    "timestamp": 1069390800000,
                    "value": 0.399044000000000009809042467168183065950870513916015625
                },
                {
                    "timestamp": 1069650000000,
                    "value": 0.398660000000000014352963262354023754596710205078125
                },
                {
                    "timestamp": 1069736400000,
                    "value": 0.39805999999999996941113522552768699824810028076171875
                },
                {
                    "timestamp": 1069822800000,
                    "value": 0.39754999999999995896615700985421426594257354736328125
                },
                {
                    "timestamp": 1069995600000,
                    "value": 0.3968499999999999250377413773094303905963897705078125
                },
                {
                    "timestamp": 1070254800000,
                    "value": 0.396539999999999948077089584330678917467594146728515625
                },
                {
                    "timestamp": 1070341200000,
                    "value": 0.396339999999999914592763161635957658290863037109375
                },
                {
                    "timestamp": 1070427600000,
                    "value": 0.3958459999999999201492073552799411118030548095703125
                }
            ]
        },
        "next_url": "https://api.tradeiqai.com/v1/indicators/sma/AAPL?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTAuMzY0OCUyQyUyMmglMjIlM0EwJTJDJTIybCUyMiUzQTAlMkMlMjJ0JTIyJTNBMTA2NDQ2MjQwMDAwMCU3RCZhcz0mZXhwYW5kX3VuZGVybHlpbmc9ZmFsc2UmbGltaXQ9MTAmb3JkZXI9YXNjJnNlcmllc190eXBlPWNsb3NlJnRpbWVzcGFuPWRheSZ0aW1lc3RhbXAuZ3Q9MTA3MDQyNzYwMDAwMCZ3aW5kb3c9NTA"
    }
}