ClickAPIs
Examples · Do stocks, bonds and gold still diversify?

Examples / Everyday

Do stocks, bonds and gold still diversify?

Level 2 · EverydayPOST/v1/correlation

What it answers

Correlation matrix of daily returns for one year, the most and least correlated pairs, annualised volatilities, and a 60-day rolling correlation for the first pair.

Request

Input POST /v1/correlation
{
  "symbols": [
    "SPY",
    "TLT",
    "GLD",
    "BTCUSD"
  ],
  "lookback_days": 252,
  "rolling_window": 60
}
Open in playground

Response

Output 200 OK
{
  "ok": true,
  "data": {
    "symbols": [
      "SPY",
      "TLT",
      "GLD",
      "BTCUSD"
    ],
    "method": "pearson",
    "on": "returns",
    "frequency": "daily",
    "start": "2025-11-12",
    "end": "2026-11-12",
    "observations": 252,
    "observations_used": 252,
    "matrix": [
      [
        1.0,
        0.2735,
        0.3613,
        0.4557
      ],
      [
        0.2735,
        1.0,
        0.1651,
        0.0832
      ],
      [
        0.3613,
        0.1651,
        1.0,
        0.3102
      ],
      [
        0.4557,
        0.0832,
        0.3102,
        1.0
      ]
    ],
    "most_correlated": [
      {
        "a": "SPY",
        "b": "BTCUSD",
        "correlation": 0.455701
      },
      {
        "a": "SPY",
        "b": "GLD",
        "correlation": 0.361285
      },
      {
        "a": "GLD",
        "b": "BTCUSD",
        "correlation": 0.310205
      },
      {
        "a": "SPY",
        "b": "TLT",
        "correlation": 0.273483
      },
      {
        "a": "TLT",
        "b": "GLD",
        "correlation": 0.165059
      }
    ],
    "least_correlated": [
      {
        "a": "TLT",
        "b": "BTCUSD",
        "correlation": 0.083198
      },
      {
        "a": "TLT",
        "b": "GLD",
        "correlation": 0.165059
      },
      {
        "a": "SPY",
        "b": "TLT",
        "correlation": 0.273483
      },
      {
        "a": "GLD",
        "b": "BTCUSD",
        "correlation": 0.310205
      },
      {
        "a": "SPY",
        "b": "GLD",
        "correlation": 0.361285
      }
    ],
    "annual_volatility": {
      "SPY": 0.137333,
      "TLT": 0.096837,
      "GLD": 0.289481,
      "BTCUSD": 0.434839
    },
    "notes": []
  },
  "meta": {
    "op": "correlation",
    "units": 5,
    "cost_usd": 0.0,
    "billing": "internal",
    "free_call": false,
    "free_calls_left": 0,
    "balance_usd": 5.0,
    "ms": 133,
    "interval": "1day",
    "data_as_of": "2026-11-12",
    "partial_last_bar": false
  }
}

How to read it

matrix is in the order of symbols. Values near 0 diversify; negative values hedge. The rolling series shows whether the stock–bond relationship is stable or flips with the regime.

Parameters and limits: Correlation reference. Analytics, not advice.