Skip to content

KB/api

GET /api/v1/company/{ticker}/analogs

Last verified

Auto-generated. This article is rebuilt from FastAPI route introspection by scripts/build_api_kb.py. Edit the route docstring in app/ and re-run the script β€” do not edit this file directly.

GET /api/v1/company/{ticker}/analogs

Handler: app.company.routes.get_company_analogs
Methods: GET

Description

Per-name regime-conditional analog matcher for the company dashboard.

Finds historical dates in this name’s own co_price_daily history that most closely resemble the current price setup (trailing returns, realized vol, RSI, SMA distances, drawdown) via weighted Euclidean distance + recency decay, and returns the forward-return distribution for those analog dates (5-day and 20-day horizons).

When regime_split=true, the distribution is additionally broken down by the prevailing macro regime (from daily_signals) at each analog date.

EXPERIMENTAL β€” limited history, low signal until more data accrues. The response always includes a caveat block with the data-immaturity warning. Do not present this surface as validated edge.

404 when the ticker has not been scaffolded. 200 with empty stats when the price family has insufficient history (< 60 trading rows) β€” insufficient_history: true signals this case.

Parameters

In Name Type Default Description
path ticker str PydanticUndefined
query as_of_date Optional[str] ISO date (YYYY-MM-DD) for point-in-time backtest. Defaults to the most-recent price row.
query top_k int 20 Number of nearest analog dates to select. Default 20.
query recency_half_life_days int 365 Calendar-day half-life for recency decay. 0 = no decay. Default 365.
query regime_split bool False When true, break down forward-return stats by macro regime.

Curl

curl -s https://bigclawd.com/api/v1/company/{ticker}/analogs