ClickAPIs
Examples · What if you missed SPY's 10 best days?

Examples / Basics

What if you missed SPY's 10 best days?

Level 1 · BasicsPOST/v1/best-days

What it answers

SPY's best and worst days since 2000, and buy-and-hold compared with sitting out the best (or worst, or both) 5, 10, 20 and 30 days. The clustering block shows how close the best days were to the worst ones.

Request

Input POST /v1/best-days
{
  "symbol": "SPY",
  "start_date": "2000-01-01"
}
Open in playground

Response

Output 200 OK
{
  "ok": true,
  "data": {
    "symbol": "SPY",
    "start": "2000-01-03",
    "end": "2026-11-12",
    "days": 6756,
    "top_n": 10,
    "buy_hold": {
      "total": 7.303326,
      "annualized": 0.081702
    },
    "best": [
      {
        "rank": 1,
        "date": "2008-10-13",
        "return": 0.145244,
        "below_sma200": true
      },
      {
        "rank": 2,
        "date": "2008-10-28",
        "return": 0.116727,
        "below_sma200": true
      },
      {
        "rank": 3,
        "date": "2025-04-09",
        "return": 0.105025,
        "below_sma200": true
      },
      {
        "rank": 4,
        "date": "2020-03-24",
        "return": 0.090593,
        "below_sma200": true
      },
      {
        "rank": 5,
        "date": "2020-03-13",
        "return": 0.085467,
        "below_sma200": true
      },
      {
        "rank": 6,
        "date": "2009-03-23",
        "return": 0.071682,
        "below_sma200": true
      },
      {
        "rank": 7,
        "date": "2008-11-24",
        "return": 0.069355,
        "below_sma200": true
      },
      {
        "rank": 8,
        "date": "2020-04-06",
        "return": 0.067188,
        "below_sma200": true
      },
      {
        "rank": 9,
        "date": "2008-11-13",
        "return": 0.062329,
        "below_sma200": true
      },
      {
        "rank": 10,
        "date": "2008-10-20",
        "return": 0.060053,
        "below_sma200": true
      }
    ],
    "worst": [
      {
        "rank": 1,
        "date": "2020-03-16",
        "return": -0.109409,
        "below_sma200": true
      },
      {
        "rank": 2,
        "date": "2008-10-15",
        "return": -0.098422,
        "below_sma200": true
      },
      {
        "rank": 3,
        "date": "2020-03-12",
        "return": -0.095682,
        "below_sma200": true
      },
      {
        "rank": 4,
        "date": "2008-12-01",
        "return": -0.088524,
        "below_sma200": true
      },
      {
        "rank": 5,
        "date": "2008-09-29",
        "return": -0.078348,
        "below_sma200": true
      },
      {
        "rank": 6,
        "date": "2020-03-09",
        "return": -0.078075,
        "below_sma200": true
      },
      {
        "rank": 7,
        "date": "2008-11-20",
        "return": -0.074118,
        "below_sma200": true
      },
      {
        "rank": 8,
        "date": "2008-10-09",
        "return": -0.06988,
        "below_sma200": true
      },
      {
        "rank": 9,
        "date": "2011-08-08",
        "return": -0.065055,
        "below_sma200": true
      },
      {
        "rank": 10,
        "date": "2008-11-19",
        "return": -0.064127,
        "below_sma200": true
      }
    ],
    "missing": [
      {
        "missed": 5,
        "miss_best_total": 3.96313,
        "miss_best_annualized": 0.061243,
        "miss_worst_total": 12.612483,
        "miss_worst_annualized": 0.101725,
        "miss_both_total": 7.136561,
        "miss_both_annualized": 0.080888
      },
      {
        "missed": 10,
        "miss_best_total": 2.603629,
        "miss_best_annualized": 0.048714,
        "miss_worst_total": 18.594933,
        "miss_worst_annualized": 0.116717,
        "miss_both_total": 7.504165,
        "miss_both_annualized": 0.082661
      },
      {
        "missed": 20,
        "miss_best_total": 1.111241,
        "miss_best_annualized": 0.028115,
        "miss_worst_total": 33.155102,
        "miss_worst_annualized": 0.139978,
        "miss_both_total": 7.684429,
        "miss_both_annualized": 0.083504
      },
      {
        "missed": 30,
        "miss_best_total": 0.345935,
        "miss_best_annualized": 0.011084,
        "miss_worst_total": 54.167369,
        "miss_worst_annualized": 0.16044,
        "miss_both_total": 7.942401,
        "miss_both_annualized": 0.084682
      }
    ],
    "clustering": {
      "window_days": 14,
      "best_near_a_worst": 7,
      "best_near_a_worst_share": 0.7,
      "worst_near_a_best": 9,
      "worst_near_a_best_share": 0.9,
      "best_days_below_sma200_share": 1.0
    },
    "notes": [
      "Missing a day = holding cash (0% return) that day instead of the asset; all other days compound.",
      "Clustering: how many of the top 10 best days fell within 14 calendar days of one of the top worst days (and the reverse).",
      "below_sma200: the prior close was under its 200-day average (null before 200 bars of history)."
    ]
  },
  "meta": {
    "op": "best-days",
    "units": 2,
    "cost_usd": 0.0,
    "billing": "internal",
    "free_call": false,
    "free_calls_left": 0,
    "balance_usd": 5.0,
    "ms": 1,
    "interval": "1day",
    "data_as_of": "2026-11-12",
    "partial_last_bar": false
  }
}

How to read it

missing[].miss_best_annualized against buy_hold.annualized is the cost of missing the best days; miss_both shows that dodging the worst days as well mostly cancels it. clustering.best_near_a_worst_share is the share of best days within two weeks of a worst day.

Parameters and limits: Best & worst days reference. Analytics, not advice.