GET
/v1/indicators/macd/{ticker}
Moving Average Convergence/Divergence (MACD)
Retrieve the Moving Average Convergence/Divergence (MACD) for a specified ticker over a defined time range. MACD is a momentum indicator derived from two moving averages, helping to identify trend strength, direction, and potential trading signals.
Endpoint Details
| HTTP Method | GET |
|---|---|
| Path | /v1/indicators/macd/{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/macd/AAPL?api_key=YOUR_API_KEY"
Note: Replace YOUR_API_KEY with your actual API key.
Response Attributes
| Attribute | Type | Description |
|---|---|---|
ok | boolean | Indicates if the request was successful (e.g., 1) |
data | object | Response data object |
data.status | string | Response status (typically "OK") (e.g., OK) |
data.request_id | string | Unique identifier for the request (e.g., 35154c799dfdcafee313fcfbacd24f17) |
data.results | object | Array or object containing the endpoint-specific data |
data.results.underlying | object | |
data.results.underlying.properties | unknown | |
data.results.values | array | Array of objects |
| Array items contain: | ||
data.results.values[].timestamp | integer | Integer (e.g., 1066276800000) |
data.results.values[].value | double | Floating point number (e.g., 0.0092174229330306) |
data.results.values[].signal | double | Floating point number (e.g., 0.0042636041644348) |
data.results.values[].histogram | double | Floating point number (e.g., 0.0049538187685958) |
data.next_url | string | URL for pagination to fetch the next page of results (e.g., https://api.tradeiqai.com/v1/indicators/macd/AAPL?...) |
Example Response
{
"ok": true,
"data": {
"status": "OK",
"request_id": "35154c799dfdcafee313fcfbacd24f17",
"results": {
"underlying": {
"url": "https://api.tradeiqai.com/v2/aggs/ticker/AAPL/range/1/day/1063281600000/1770848071789?limit=129&sort=asc"
},
"values": [
{
"timestamp": 1066276800000,
"value": 0.0092174229330306278740181369357742369174957275390625,
"signal": 0.004263604164434809350170407782343318103812634944915771484375,
"histogram": 0.004953818768595818523847729153430918813683092594146728515625
},
{
"timestamp": 1066363200000,
"value": 0.007784112031814560683784520733752287924289703369140625,
"signal": 0.0049677057379107596168932303726251120679080486297607421875,
"histogram": 0.0028164062939038010668912903611271758563816547393798828125
},
{
"timestamp": 1066622400000,
"value": 0.0072425252911829662849640953936614096164703369140625,
"signal": 0.00542266964856520129745209857219379046000540256500244140625,
"histogram": 0.00181985564261776498751199682146761915646493434906005859375
},
{
"timestamp": 1066708800000,
"value": 0.006663874422697391164405189556418918073177337646484375,
"signal": 0.005670910603391639097370369171358106541447341442108154296875,
"histogram": 0.000992963819305752067034820385060811531729996204376220703125
},
{
"timestamp": 1066795200000,
"value": 0.0055522377089529673099832507432438433170318603515625,
"signal": 0.005647176024503905260309988278777382220141589641571044921875,
"histogram": -9.4938315550937950326737535533538903109729290008544921875e-5
},
{
"timestamp": 1066881600000,
"value": 0.004945089426572513158220090190297923982143402099609375,
"signal": 0.00550675870491762649294731346572007169015705585479736328125,
"histogram": -0.00056166927834511333472722327542214770801365375518798828125
},
{
"timestamp": 1066968000000,
"value": 0.0038546445964844355813738729921169579029083251953125,
"signal": 0.0051763358832309890045220157617222866974771022796630859375,
"histogram": -0.0013216912867465534231481427696053287945687770843505859375
},
{
"timestamp": 1067230800000,
"value": 0.00301222036098536261050639950553886592388153076171875,
"signal": 0.00474351277878186372571889251048560254275798797607421875,
"histogram": -0.00173129241779650111521249300494673661887645721435546875
},
{
"timestamp": 1067317200000,
"value": 0.003857475215098826737403214792720973491668701171875,
"signal": 0.00456630526604525667500045216229409561492502689361572265625,
"histogram": -0.00070883005094642993759723736957312212325632572174072265625
},
{
"timestamp": 1067403600000,
"value": 0.0043880028049017028024536557495594024658203125,
"signal": 0.004530644773816545900491092879747156985104084014892578125,
"histogram": -0.000142641968914843098037437130187754519283771514892578125
}
]
},
"next_url": "https://api.tradeiqai.com/v1/indicators/macd/AAPL?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTAuMzY0OCUyQyUyMmglMjIlM0EwJTJDJTIybCUyMiUzQTAlMkMlMjJ0JTIyJTNBMTA2NDQ2MjQwMDAwMCU3RCZhcz0mZXhwYW5kX3VuZGVybHlpbmc9ZmFsc2UmbGltaXQ9MTAmbG9uZ193aW5kb3c9MjYmb3JkZXI9YXNjJnNlcmllc190eXBlPWNsb3NlJnNob3J0X3dpbmRvdz0xMiZzaWduYWxfd2luZG93PTkmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5ndD0xMDY3NDAzNjAwMDAw"
}
}