Indices · Statistics
Indices seasonality
/v1/indices/seasonalityindicesSeasonalityHow one index has behaved by calendar month and by weekday over the last years (3 to 20): the mean and median return in percent and the share of positive observations. Monthly returns compound the daily returns of each complete month (the running month is left out); weekday returns are simple daily returns. Months or weekdays without observations are null. Daily bars read in at most three requests. The statistics use all the years requested whatever your plan's history window; the window limits the dated rows returned, and this route returns none. No index values are returned.
Example request
curl -sS --get "https://api.ordermap.si/v1/indices/seasonality" \
-H "Authorization: Bearer $ORDERMAP_API_KEY" \
--data-urlencode symbol=SPXconst params = new URLSearchParams({
symbol: "SPX",
});
const res = await fetch(`https://api.ordermap.si/v1/indices/seasonality?${params}`, {
headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data, meta } = await res.json();
console.log(data, meta.coverage);Set ORDERMAP_API_KEY to your key. Replace the dates with a recent trading date.
Parameters
2 parameters, 1 required.
| Parameter | Type and limits | Description |
|---|---|---|
symbolqueryrequired | stringat most 10 characterspattern ^[A-Za-z][A-Za-z0-9]{0,9}$ | Index symbol, for example SPX. |
yearsqueryoptional | integerdefault 10min 3max 20 | Years of history, 3 to 20. |
Response
| Status | Meaning | Body |
|---|---|---|
200 | Successful response. | Schema below |
400 | Invalid, unknown or repeated parameters, or an invalid cursor. | Error object |
401 | Missing or invalid API key. | Error object |
403 | The plan, dataset release or account state does not allow this request. | Error object |
422 | The request is valid but no data exists for it. | Error object |
429 | Rate limit, burst limit or cooldown; wait Retry-After seconds.Retry-After | Error object |
500 | Internal error. | Error object |
503 | Data temporarily unavailable; retry after Retry-After seconds.Retry-After | Error object |
504 | The request timed out. | Error object |
Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.
200 response body
dataobjectrequiredSeasonality of one index.14 fields insideby_montharray<object>requiredTwelve rows, January first.5 fields insideaverage_return_pctnumber | nullrequiredMean monthly return in percent (daily returns compounded within the month).median_return_pctnumber | nullrequiredMedian monthly return in percent.monthintegerCalendar month, 1 (January) to 12.observationsintegerrequiredMonths behind the figures.win_ratenumber | nullrequiredShare of months with a positive return, 0 to 1.
by_weekdayarray<object>requiredFive rows, Monday first.5 fields insideaverage_return_pctnumber | nullrequiredMean daily return in percent.median_return_pctnumber | nullrequiredMedian daily return in percent.observationsintegerrequiredDays behind the figures.weekdayintegerWeekday, 1 (Monday) to 5 (Friday).win_ratenumber | nullrequiredShare of days with a positive return, 0 to 1.
symbolstringrequiredSymbol.yearsintegerrequiredYears of history requested.
metaobjectrequiredMeta object
Example response
{
"data": {
"by_month": [
{
"average_return_pct": 1.1,
"median_return_pct": 1.4,
"month": 1,
"observations": 10,
"win_rate": 0.7
}
],
"by_weekday": [
{
"average_return_pct": 0.04,
"median_return_pct": 0.07,
"observations": 520,
"weekday": 1,
"win_rate": 0.55
}
],
"symbol": "SPX",
"years": 10
},
"meta": {
"as_of": 1760659200123,
"coverage": {
"complete": true
},
"delay_ms": 0,
"delayed": false,
"request_id": "0199f0c2-5a1e-7c3b-9d4e-2b6f8a1c3d5e",
"source": "index_feed"
}
}Values are illustrative. Missing values are null, never 0.
