ClickAPIs
Docs · Trader statistics

Docs / Endpoints

Trader statistics

POST/v1/trader-statsunits: 2intraday

How a symbol trades: the win rate of days, weeks, months and years, average and largest up and down moves, the longest winning and losing streaks, volume on up versus down days, and a year-by-year table.

Add "async": true to run it as a job, and "webhook_url" to be called when it finishes (Jobs & async). Calls estimated above 1,000 units run as jobs automatically. Supports interval for intraday bars at 5× the units (Intraday).

Parameters

FieldTypeDefaultDescription
symbolrequiredstring—Ticker.
start_datedate—YYYY-MM-DD. First date to include. Default: the full history available.
end_datedate—YYYY-MM-DD. Last date to include. Default: the latest bar.
intervalstring"1day""1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday.

Example request

How often does SPY close higher? Read the walkthrough →

Request POST /v1/trader-stats
{
  "symbol": "SPY",
  "start_date": "2010-01-01"
}
The same call with curl, Python and JavaScript
curl https://clickapis.com/v1/trader-stats \
  -H "Authorization: Bearer $CLICKAPIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"SPY","start_date":"2010-01-01"}'
import os, requests

r = requests.post(
    "https://clickapis.com/v1/trader-stats",
    headers={"Authorization": f"Bearer {os.environ['CLICKAPIS_KEY']}"},
    json={
      "symbol": "SPY",
      "start_date": "2010-01-01"
    },
    timeout=60,
)
print(r.json()["data"])
const r = await fetch("https://clickapis.com/v1/trader-stats", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.CLICKAPIS_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "symbol": "SPY",
    "start_date": "2010-01-01"
  }),
});
console.log((await r.json()).data);

Example response

Response 200 OK
{
  "ok": true,
  "data": {
    "symbol": "SPY",
    "start": "2010-01-04",
    "end": "2026-11-12",
    "bars": {
      "count": 4241,
      "up": 2336,
      "down": 1887,
      "flat": 18,
      "win_rate": 0.550813,
      "avg_return": 0.000575,
      "avg_up_move": 0.007027,
      "avg_down_move": -0.007408,
      "median_up_move": 0.005135,
      "median_down_move": -0.00456,
      "payoff_ratio": 0.94861,
      "largest_up": {
        "date": "2025-04-09",
        "return": 0.105025
      },
      "largest_down": {
        "date": "2020-03-16",
        "return": -0.109409
      },
      "longest_winning_streak": {
        "length": 14,
        "start": "2010-02-26",
        "end": "2010-03-17"
      },
      "longest_losing_streak": {
        "length": 8,
        "start": "2018-12-13",
        "end": "2018-12-24"
      },
      "current_streak": -1
    },
    "weeks": {
      "count": 879,
      "positive": 514,
      "positive_pct": 0.584755,
      "avg_return": 0.002733,
      "median_return": 0.00382,
      "best": {
        "period_end": "2020-04-09",
        "return": 0.12093
      },
      "worst": {
        "period_end": "2020-03-20",
        "return": -0.145458
      }
    },
    "months": {
      "count": 202,
      "positive": 138,
      "positive_pct": 0.683168,
      "avg_return": 0.012017,
      "median_return": 0.016484,
      "best": {
        "period_end": "2020-04-30",
        "return": 0.126978
      },
      "worst": {
        "period_end": "2020-03-31",
        "return": -0.124861
      }
    },
    "years": {
      "count": 16,
      "positive": 14,
      "positive_pct": 0.875,
      "avg_return": 0.146504,
      "median_return": 0.168552,
      "best": {
        "period_end": "2013-12-31",
        "return": 0.323017
      },
      "worst": {
        "period_end": "2022-12-30",
        "return": -0.181737
      }
    },
    "volume": {
      "up_volume_total": 231105026336.0,
      "down_volume_total": 220199665117.0,
      "up_down_volume_ratio": 1.049525,
      "avg_volume_up_bars": 98931946.0,
      "avg_volume_down_bars": 116692986.0,
      "avg_volume_ratio": 0.847797
    },
    "by_year": [
      {
        "year": 2026,
        "return": 0.115018,
        "bars": 218,
        "up": 110,
        "down": 108,
        "win_rate": 0.504587,
        "best_bar": 0.029079,
        "worst_bar": -0.044092,
        "volatility": 0.140096,
        "partial": true
      },
      {
        "year": 2025,
        "return": 0.177207,
        "bars": 250,
        "up": 143,
        "down": 107,
        "win_rate": 0.572,
        "best_bar": 0.105025,
        "worst_bar": -0.058535,
        "volatility": 0.194349,
        "partial": false
      },
      {
        "year": 2024,
        "return": 0.248851,
        "bars": 252,
        "up": 148,
        "down": 103,
        "win_rate": 0.587302,
        "best_bar": 0.024863,
        "worst_bar": -0.029808,
        "volatility": 0.125366,
        "partial": false
      },
      {
        "year": 2023,
        "return": 0.261724,
        "bars": 250,
        "up": 140,
        "down": 109,
        "win_rate": 0.56,
        "best_bar": 0.022935,
        "worst_bar": -0.020055,
        "volatility": 0.130421,
        "partial": false
      },
      {
        "year": 2022,
        "return": -0.181737,
        "bars": 251,
        "up": 109,
        "down": 141,
        "win_rate": 0.434263,
        "best_bar": 0.054953,
        "worst_bar": -0.043483,
        "volatility": 0.241804,
        "partial": false
      },
      "… 9 more items …",
      {
        "year": 2012,
        "return": 0.159897,
        "bars": 250,
        "up": 136,
        "down": 111,
        "win_rate": 0.544,
        "best_bar": 0.024964,
        "worst_bar": -0.025149,
        "volatility": 0.127031,
        "partial": false
      },
      {
        "year": 2011,
        "return": 0.018809,
        "bars": 252,
        "up": 136,
        "down": 116,
        "win_rate": 0.539683,
        "best_bar": 0.046504,
        "worst_bar": -0.065055,
        "volatility": 0.229558,
        "partial": false
      },
      {
        "year": 2010,
        "return": 0.131473,
        "bars": 251,
        "up": 145,
        "down": 104,
        "win_rate": 0.577689,
        "best_bar": 0.044015,
        "worst_bar": -0.037846,
        "volatility": 0.178386,
        "partial": true
      }
    ],
    "notes": [
      "A bar is up when its close is above the previous close; flat bars count as neither.",
      "Week, month and year returns run from the last close of one calendar period to the last close of the next; the first period is dropped and the latest may be in progress.",
      "current_streak: consecutive up (+) or down (-) closes ending at the latest bar."
    ],
    "interval": "1day"
  },
  "meta": {
    "op": "trader-stats",
    "units": 2,
    "cost_usd": 0.0,
    "billing": "internal",
    "free_call": false,
    "free_calls_left": 0,
    "balance_usd": 5.0,
    "ms": 10,
    "interval": "1day",
    "data_as_of": "2026-11-12",
    "partial_last_bar": false
  }
}

Every response has the same envelope: ok, data and meta (op, units, cost_usd, ms, interval, billing, balance_usd, data_as_of, partial_last_bar). Numbers are decimals (0.05 = 5%), dates ISO, and a value that cannot be computed is null.

More examples