Strategies API
Auto-generated from
openapi-snapshot.json. Do not edit by hand — changes are overwritten byscripts/docs/generate_api_reference.py.
28 endpoints in this group.
GET /api/strategies
List Strategies
List active strategies for a tenant from the database.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | query | — | optional | |
agent_id | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies
Create Strategy
Create a new strategy. Returns the created row (joined with agent_name) so the frontend can insert it straight into state.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/clone
Clone Template
Clone a built-in template into the strategies table for a user.
Returns: {“strategy_id”: int, “template_id”: str, “tenant_id”: int}
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/crisis_alpha/hedge-plan
Crisis Alpha Hedge Plan
Return a read-only crisis-alpha / tail-hedge sleeve plan.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/crisis_alpha/regime-context
Crisis Alpha Regime Context
Return cached canonical risk context for crisis-alpha hedge-plan requests.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/cross_sectional_momentum/rankings
Cross Sectional Momentum Rankings
Return the latest persisted cross-sectional momentum rankings.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
bucket | query | string | optional | |
direction | query | string | optional | |
symbol | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/diagonal_calendar/evaluate
Diagonal Calendar Evaluate
Score a short-front / long-back calendar or diagonal options pair.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/hierarchical_risk_parity/allocate
Hierarchical Risk Parity Allocate
Return a read-only HRP allocation from caller-supplied price history.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/iv_surface/scan
Iv Surface Scan
Return ranked IV surface / earnings vol-crush candidates.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/order_flow_cvd/scan
Order Flow Cvd Scan
Return ranked Order Flow / CVD strategy signals.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/pairs/scan
Pairs Scan
Return the latest persisted pairs-trading spread signals.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
signal | query | string | optional | |
symbol | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/pead/scan
Pead Scan
Return the latest persisted Earnings PEAD candidates.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
direction | query | string | optional | |
symbol | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/portfolio_cvar/report
Portfolio Cvar Report
Return portfolio CVaR / Expected Shortfall metrics for supplied returns.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/portfolio_greeks/snapshot
Portfolio Greeks Snapshot
Return a tenant-scoped portfolio Greeks snapshot for open option positions.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
account_id | query | — | optional | |
tenant_id | query | — | optional | |
stress_move_pct | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/risk_parity/allocate
Risk Parity Allocate
Return a read-only Risk Parity / Vol Target allocation.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/sector_rotation/strength
Sector Rotation Strength
Return the latest Sector Rotation strength ranking and RS matrix.
Responses
| Code | Description |
|---|---|
200 | Successful Response |
POST /api/strategies/stress_testing/report
Stress Testing Report
Return deterministic scenario-stress results for supplied positions.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/stress_testing/scenarios
Stress Testing Scenarios
Return selectable stress-testing scenarios accepted by the report endpoint.
Responses
| Code | Description |
|---|---|
200 | Successful Response |
POST /api/strategies/suggest
Suggest
Ask the configured LLM to propose count strategies matching the inputs.
Returns: {“suggestions”: [StrategySuggestion, …], “count”: int}
Errors: 400 — LLM returned unparseable output (bad JSON / wrong shape). 503 — LLM client misconfigured (missing API key / provider). 500 — Any other unexpected failure.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/templates
List Templates
Return all built-in strategy templates.
Returns: {“templates”: {template_id: {name, theme, description, conditions_json, asset_types, timeframe, key_rules}, …}}
Responses
| Code | Description |
|---|---|
200 | Successful Response |
GET /api/strategies/templates/{template_id}
Get Template
Return a single strategy template by id.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
template_id | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/strategies/trend_following/signal
Trend Following Signal
Return a Donchian trend-following signal for supplied OHLC bars.
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/vol_risk_premium/iv-rank
Vol Risk Premium Iv Rank
Return latest tenant-scoped IV-rank snapshots for premium screens.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
symbol | query | — | optional | |
tenant_id | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/vol_risk_premium/theta-watchlist
Vol Risk Premium Theta Watchlist
Return latest tenant-scoped theta premium candidates from IV snapshots.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
symbol | query | — | optional | |
tenant_id | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/strategies/wheel_tracker/cycles
Wheel Tracker Cycles
Return tenant-scoped Wheel Strategy cycle state and PnL rows.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
state | query | string | optional | |
symbol | query | — | optional | |
account_id | query | — | optional | |
tenant_id | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
DELETE /api/strategies/{strategy_id}
Delete Strategy
Soft-delete a strategy by setting is_active=FALSE. Keeps the row so historical agent_signals.strategy_id references stay intact.
Returns: {“strategy_id”: int, “is_active”: bool, “deleted”: bool}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id | path | integer | required | |
tenant_id | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
PATCH /api/strategies/{strategy_id}/assign-agent
Assign Agent
Set or clear the agent assignment. Pass agent_id=null to unassign.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id | path | integer | required |
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
PATCH /api/strategies/{strategy_id}/toggle
Toggle Strategy
Flip is_active on a strategy. Returns {strategy_id, is_active}.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id | path | integer | required |
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |