Docs / Endpoints
Event study
POST/v1/event-studyunits: 3 per symbolintraday
Every time a condition was true, what happened next: forward returns at several horizons, win rate, and the edge over all other bars with t-statistics. Pool up to 100 symbols in one call.
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
| Field | Type | Default | Description |
|---|---|---|---|
symbolsrequired | array of string | — | 1–100 tickers (one ticker for intraday). |
conditionrequired | string (expression) | — | When the event happens, e.g. rsi(14) < 30 and close > sma(200). |
horizons | array of integer | [1, 5, 10, 20, 60] | Forward horizons in bars. |
cooldown_bars | integer | — | Ignore repeat signals within this many bars of the last one. |
start_date | date | — | YYYY-MM-DD. First date to include. Default: the full history available. |
end_date | date | — | YYYY-MM-DD. Last date to include. Default: the latest bar. |
interval | string | "1day" | "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. |
Example request
What usually happens after a 3-day losing streak in QQQ? Read the walkthrough →
POST /v1/event-study{ "symbols": [ "QQQ" ], "condition": "streak() == -3", "horizons": [ 1, 5, 20 ], "start_date": "2010-01-01" }
The same call with curl, Python and JavaScript
curl https://clickapis.com/v1/event-study \
-H "Authorization: Bearer $CLICKAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{"symbols":["QQQ"],"condition":"streak() == -3","horizons":[1,5,20],"start_date":"2010-01-01"}'import os, requests
r = requests.post(
"https://clickapis.com/v1/event-study",
headers={"Authorization": f"Bearer {os.environ['CLICKAPIS_KEY']}"},
json={
"symbols": [
"QQQ"
],
"condition": "streak() == -3",
"horizons": [
1,
5,
20
],
"start_date": "2010-01-01"
},
timeout=60,
)
print(r.json()["data"])const r = await fetch("https://clickapis.com/v1/event-study", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CLICKAPIS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"symbols": [
"QQQ"
],
"condition": "streak() == -3",
"horizons": [
1,
5,
20
],
"start_date": "2010-01-01"
}),
});
console.log((await r.json()).data);Example response
{ "ok": true, "data": { "condition": "streak() == -3", "cooldown_bars": 1, "symbols": 1, "occurrences": 202, "horizon_unit": "trading days", "results": [ { "count": 202, "mean": 0.003496, "median": 0.003472, "win_rate": 0.594059, "stdev": 0.014759, "t_stat": 3.366597, "p25": -0.004901, "p75": 0.010527, "best": 0.054445, "worst": -0.046493, "horizon": 1, "baseline_mean": 0.000754, "baseline_win_rate": 0.557416, "edge": 0.002742, "edge_t_stat": 2.592218 }, { "count": 202, "mean": 0.006411, "median": 0.007394, "win_rate": 0.628713, "stdev": 0.031401, "t_stat": 2.901629, "p25": -0.00938, "p75": 0.027084, "best": 0.101641, "worst": -0.12539, "horizon": 5, "baseline_mean": 0.003705, "baseline_win_rate": 0.602549, "edge": 0.002706, "edge_t_stat": 1.203891 }, { "count": 201, "mean": 0.017638, "median": 0.022334, "win_rate": 0.666667, "stdev": 0.057333, "t_stat": 4.361595, "p25": -0.016626, "p75": 0.053894, "best": 0.205272, "worst": -0.228383, "horizon": 20, "baseline_mean": 0.015009, "baseline_win_rate": 0.670298, "edge": 0.002629, "edge_t_stat": 0.638132 } ], "per_symbol": null, "recent": [ { "symbol": "QQQ", "date": "2026-11-02", "close": 681.09, "ret_1d": 0.006152, "ret_5d": -0.002555, "ret_20d": null }, { "symbol": "QQQ", "date": "2026-10-14", "close": 728.95, "ret_1d": -0.001303, "ret_5d": -0.005144, "ret_20d": -0.052912 }, { "symbol": "QQQ", "date": "2026-09-10", "close": 708.69, "ret_1d": 0.008734, "ret_5d": 0.011613, "ret_20d": 0.054876 }, { "symbol": "QQQ", "date": "2026-08-18", "close": 717.51, "ret_1d": -0.001993, "ret_5d": -0.009463, "ret_20d": -0.017826 }, { "symbol": "QQQ", "date": "2026-07-24", "close": 684.23, "ret_1d": -0.003084, "ret_5d": 0.005495, "ret_20d": 0.04269 }, "… 12 more items …", { "symbol": "QQQ", "date": "2025-08-18", "close": 574.35, "ret_1d": -0.013581, "ret_5d": -0.01177, "ret_20d": 0.024375 }, { "symbol": "QQQ", "date": "2025-06-20", "close": 523.72, "ret_1d": 0.010273, "ret_5d": 0.041511, "ret_20d": 0.072081 }, { "symbol": "QQQ", "date": "2025-04-21", "close": 430.55, "ret_1d": 0.026269, "ret_5d": 0.090744, "ret_20d": 0.205272 } ], "notes": [ "Forward returns are close-to-close from the signal bar and overlap when occurrences are closer together than the horizon; t-stats are therefore optimistic." ], "interval": "1day" }, "meta": { "op": "event-study", "units": 3, "cost_usd": 0.0, "billing": "internal", "free_call": false, "free_calls_left": 0, "balance_usd": 5.0, "ms": 27, "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.