Trading Intel API

72 endpoints in this group.

POST /api/trading-intel/backtest

Run Backtest

Simulate a strategy over the requested date range using realized_trades.

Returns equity curve, CAGR, Sharpe, Sortino, max drawdown, win rate, profit factor, and a per-trade log.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/committee/config

Get Committee Config

Responses

CodeDescription
200Successful Response

PATCH /api/trading-intel/committee/config

Update Committee Config

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/committee/runs

List Committee Runs

Parameters

NameInTypeRequiredDescription
limitqueryintegeroptional
symbolquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/committee/runs

Create Committee Run

Create and enqueue an Investment Committee run.

Request body: application/json

Responses

CodeDescription
202Successful Response
422Validation Error

GET /api/trading-intel/committee/runs/{run_id}

Get Committee Run

Parameters

NameInTypeRequiredDescription
run_idpathstringrequired

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/committee/runs/{run_id}/events

Get Committee Run Events

Parameters

NameInTypeRequiredDescription
run_idpathstringrequired

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/committee/runs/{run_id}/promote

Promote Committee Run

Parameters

NameInTypeRequiredDescription
run_idpathstringrequired

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/correlation

Get Correlation

Pearson correlation matrix for portfolio holdings + major benchmark indices.

Fetches the latest snapshot holdings (up to 20 symbols by market value), combines with SPY / QQQ / IWM / GLD / TLT / UUP benchmarks, then pulls 90-day daily closes via the market-data factory (ThetaData -> yfinance fallback). Returns an NxN matrix of Pearson r values rounded to 3 decimal places.

response is cached in Redis under bp:corr:v1:{tenant}:{account}:{symbols_hash}:{lookback} with a TTL of ~15 min during RTH and ~24h overnight. Cache hit served with X-Cache: HIT; cache miss computes, writes back, and serves with X-Cache: MISS. ETag (MD5 of response body) is always set; If-None-Match returns 304.

Parameters

NameInTypeRequiredDescription
account_idquery—optionalOptional broker account scope
lookback_daysqueryintegeroptionalRolling window length in calendar days (default 90).
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/email-briefing

Send Email Briefing

Compose and send a daily trading briefing email via SendGrid.

Parameters

NameInTypeRequiredDescription
account_idquery—optional

Request body: application/json

Responses

CodeDescription
200Successful Response
402Payment Required
422Validation Error

GET /api/trading-intel/eod/history

Get Eod History

Parameters

NameInTypeRequiredDescription
account_idquery—optional
daysqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/eod/review

Get Eod Review

Parameters

NameInTypeRequiredDescription
account_idquery—optional
review_datequery—optionalYYYY-MM-DD, defaults to today
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/exit

Get Exit Strategies

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/exit/compute

Compute Exit

Compute ATR-based stop-loss and trailing stops for open positions.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/extended-hours

Get Extended Hours

Parameters

NameInTypeRequiredDescription
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/feedback

Get Feedback Stats

Feedback loop: compare recommendations to realized outcomes.

Parameters

NameInTypeRequiredDescription
daysqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/gameplan

Get Game Plan

Pre-market game plan: signals + enriched market events with portfolio tagging.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/hedging

Get Hedge Recommendations

Suggest inverse-ETF hedges for concentrated positions (>10% weight).

Parameters

NameInTypeRequiredDescription
account_idquery—optional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intel-feed

Get Intel Feed

Unified chronological intelligence feed.

Aggregates from four sources into a single time-ordered stream:

  • intraday_signals → tag SIGNAL
  • options_flow_signals → tag FLOW
  • recommendations → tag ALERT (conf ≥ 0.80) or SIGNAL
  • external_intel → tag NEWS

Each item: id, tag, symbol, text, confidence, source, created_at.

Parameters

NameInTypeRequiredDescription
hoursqueryintegeroptionalLook-back window in hours
limitqueryintegeroptional
tagquery—optionalFilter by category: SIGNAL
symbolquery—optionalFilter to a single ticker
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/bars

Get Intraday Bars

Return today's OHLCV + VWAP/RSI/MACD bars for a symbol, oldest-first.

Sourced from market_data_intraday populated by fetch_and_store_bars(). Suitable for feeding directly to a charting library.

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol
limitqueryintegeroptionalMax bars to return

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/intraday/detect

Detect Intraday

Fetch live bars from yfinance, compute indicators, run setup detectors.

Steps:

  1. fetch_and_store_bars — pull OHLCV, compute VWAP/RSI/MACD, upsert market_data_intraday.
  2. detect_setups — run ORB / VWAP-reclaim / gap / volume-spike detectors, write results to intraday_signals.

Parameters

NameInTypeRequiredDescription
sessionquery—optionalREGULAR
asofquery—optionalYYYY-MM-DD anchor date

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/intraday/detect/portfolio

Detect Intraday Portfolio

Run intraday detection against the user's current portfolio positions.

Fetches the latest position symbols (up to limit, ordered by market_value DESC), then delegates to the same bar-fetch + setup-detect pipeline as /intraday/detect. Returns an empty result (not an error) when no positions are held.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
intervalquerystringoptional
periodquerystringoptional
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/discovery

Get Discovery Dashboard

Discovery dashboard: stats, scan breakdown, and full result feed.

Parameters

NameInTypeRequiredDescription
scan_typequery—optionalFilter by scan type
hoursqueryintegeroptional
universequery—optionalFilter by universe
symbolquery—optionalFilter by ticker substring
limitqueryintegeroptional
sort_byquerystringoptional
sort_dirquerystringoptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/discovery/opportunities

Get Opportunities

Return ranked market opportunities filtered by minimum composite score.

Parameters

NameInTypeRequiredDescription
min_scorequerynumberoptional
limitqueryintegeroptional
hoursquery—optional
scan_typequery—optionalFilter to opportunities with a matching scanner row
universequery—optionalFilter to opportunities with a matching scanner universe
symbolquery—optionalFilter by ticker substring
sort_byquerystringoptional
sort_dirquerystringoptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/intraday/discovery/opportunities/compute

Compute Opportunities

Compute composite opportunity scores from recent scanner signals.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/intraday/discovery/scan

Run Discovery Scan

Run a live market scan using yfinance data.

Fetches OHLCV + indicators for the chosen universe, ranks by scan_type, upserts into scanner_results, and returns ranked results.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/discovery/watchlist

Get Discovery Watchlist

Return opportunity-scored symbols NOT currently in the user's portfolio.

Parameters

NameInTypeRequiredDescription
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/flow

Get Flow Dashboard

Aggregated Flow Intelligence dashboard: stats, direction_breakdown, flow list.

Ported from legacy MTM_CLAUDE options_intel.get_options_signals and extended with KPI aggregation (total, direction split, avg P/C ratio, avg confidence).

Parameters

NameInTypeRequiredDescription
hoursqueryintegeroptionalLook-back window in hours
symbolquery—optionalOptional single-ticker filter
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/intraday/flow/detect

Detect Flow

Fetch live option chains from yfinance, compute P/C ratios, upsert flow signals.

Steps:

  1. For each symbol, download nearest-expiry option chain via yfinance.
  2. Compute put_volume / call_volume ratio → classify as CALL_DOMINANCE / PUT_DOMINANCE / NEUTRAL_FLOW.
  3. Upsert result into options_flow_signals (unique per tenant+symbol+date).

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/signal-dashboard

Get Intraday Signal Dashboard

Aggregated Signal Dashboard payload: stats, setup_breakdown, full signal list.

Extracted from legacy MTM_CLAUDE trading_intel/intraday_engine.get_intraday_signals and extended with KPI aggregation for the dashboard surface.

Parameters

NameInTypeRequiredDescription
hoursqueryintegeroptionalLook-back window in hours
symbolquery—optionalOptional single-ticker filter
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/intraday/signals

Get Intraday Signals

Return recent intraday setup signals from the database.

Parameters

NameInTypeRequiredDescription
symbolquery—optionalFilter to a single ticker
hoursqueryintegeroptionalLook-back window in hours
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/market-context/indices

Get Market Indices

Return current price, change, and % change for SPY, QQQ, DIA, and ^VIX from the caller tenant's own broker connection.

Requires authentication. Unauthenticated requests receive 401.

Quotes are cached 60 seconds in Redis under a per-tenant key (market_context:indices:{tenant_id}). Unavailable payloads are cached for 10 seconds so a newly connected broker becomes visible quickly.

The response includes a data_status object:

statusreasonWhen
ok(omitted)At least one index row has a price or previous close
unavailableno_connected_brokerThe tenant has no usable configured provider or connected broker
unavailableprovider_spend_cap_exceededKept in the union for compatibility. This route never emits it: brokers never hit the vendor spend cap, and a vendor provider is rejected as platform_provider_not_licensed before any client or spend-cap gate.
unavailablequote_unavailableA broker client was resolved but no index quote could be fetched
unavailableplatform_provider_not_licensedThe resolved client is a vendor or platform provider, not the tenant's own broker
unavailableplatform_credential_not_tenant_ownedA non-Schwab broker client was resolved but the credential is not a tenant-owned DB row (platform env key, missing, or ownership unknown)

An index row may include an optional reason field. It is set only when that broker cannot serve the index (index_not_available_from_broker). Rows with data and ordinary empty rows omit the field.

This endpoint does not read the shared cross-tenant quote cache and does not fall back to a platform Polygon snapshot. A Schwab quote failure on this route does not re-enter get_quote.

Responses

CodeDescription
200Successful Response
401Missing or invalid user

POST /api/trading-intel/market-research/runs

Create Market Research Run

Return impersonal research commentary with no action or quantity fields.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/election

Get Election

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/mtm/election

Upsert Election

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/form-4797.csv

Form 4797 Csv

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired
account_idquery—optional
source_policyquerystringoptional
taxpayer_namequerystringoptional
einquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/form-4797.pdf

Form 4797 Pdf

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired
account_idquery—optional
source_policyquerystringoptional
taxpayer_namequerystringoptional
einquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/mtm/reconcile

Reconcile

Run §475(f) MTM reconciliation against realized_trades for the year. Returns totals + equity/option split + any per-trade errors.

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired
account_idquery—optional
source_policyquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/section-481

Get Section 481

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/mtm/section-481/compute

Compute Section 481

Compute the §481(a) adjustment for the tenant's active MTM election. Pulls open positions as of 12/31/<prior_year>, resolves year-end FMV, runs the pure calculator, and (optionally) persists to section_481_adjustments.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/securities-mtm.csv

Securities Mtm Csv

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired
taxpayer_namequerystringoptional
einquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/securities-mtm.pdf

Securities Mtm Pdf

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired
taxpayer_namequerystringoptional
einquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/mtm/year-end-marks

List Year End Marks

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
yearqueryintegerrequired

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/mtm/year-end-marks/fetch

Fetch Year End Marks

Resolve year-end FMV for the given symbols (or all currently-open Schwab positions if symbols omitted). Falls back yfinance → alpha_vantage → manual. When persist=True, writes results to year_end_marks.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/options/flow

Get Options Flow

Parameters

NameInTypeRequiredDescription
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/position-mgmt/allocation

Get Allocations

Fetch stored allocation recommendations.

Default: latest compute only — one row per (symbol, method) ordered by most-recent computed_at. This avoids piling up multiple days of stale recommendations in the UI and ends the schema-bifurcation drift the older lookback window was masking .

Back-compat: passing ?days=N restores the legacy "last N days" window.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
daysquery—optionalLegacy: include the last N days of compute runs. When omitted (default), returns only the latest run per (account, method) - the normal UI path .
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/position-mgmt/allocation/compute

Compute Allocations

Compute and persist allocation recommendations for one method.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/position-mgmt/exit

Get Exit Strategies

Fetch the tenant's current ATR-based exit strategies.

Computes replace the tenant's complete strategy set, so this read doesn't need a timestamp window. The production table intentionally has no computed_at column; ordering by the insertion id preserves a stable newest-first result without depending on a phantom schema field.

Parameters

NameInTypeRequiredDescription
symbolquery—optional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/position-mgmt/exit/compute

Compute Exit Strategies

Compute ATR-based stop-loss and exit levels for portfolio positions.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/position-mgmt/exit/triggers

Get Stop Triggers

Return positions where current price is at or below the stored stop-loss.

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/position-mgmt/schwab/ingest

Run Schwab Ingest

Pull Schwab transactions for the given year and persist to schwab_transactions, schwab_closed_lots, schwab_open_lots.

Idempotent — re-running refreshes raw_json and rebuilds open-lot snapshot. Safe to invoke repeatedly during Schwab session hours.

Parameters

NameInTypeRequiredDescription
yearquery—optionalYYYY, defaults to current year
account_idquery—optionalbroker_accounts.id; when omitted, ingest every Schwab-connected account

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/position-mgmt/strategy/by-symbol/{symbol}

Get Strategy By Symbol

Drill-down for a single symbol — lot-level trade list + KPIs.

Response shape matches frontend StrategyBySymbolResponse:

  • trades[]: side, quantity, cost_basis, acquired_date, sold_date, holding_days, entry_price, exit_price, proceeds, fees, pnl, pnl_pct, multiplier, source, confidence, rationale, is_orphan, is_unknown_basis, is_partial
  • summary: window_days, total_rows, kpi_rows, total_pnl, win_rate, avg_win, avg_loss, low_sample
  • data_quality: orphan_count, unknown_basis_count, partial_count, full_match_count, low_sample, low_sample_threshold

KPI eligibility: excludes rows with cost<=0 (orphans + unknown-basis) so win rate and P&L reflect only computable trades.

TODO(mobile): This endpoint is mobile-consumed via @nocookiespot/shared-types. Before P1, tighten to an explicit Pydantic v2 response_model with:

  • money fields (proceeds/cost/pnl/cum_pnl) as MoneyString (see packages/shared-types/src/schemas/money.ts in the mobile repo)
  • date fields as ISO-8601 with offset
  • summary/data_quality as named BaseModel subtypes Current shape is web-compatible (floats) and stable; coordinate the switch with mobile-claude when ready to regenerate shared-types.

Parameters

NameInTypeRequiredDescription
symbolpathstringrequired
account_idquery—optional
daysqueryintegeroptional
yearquery—optional
monthquery—optional
source_policyquerystringoptional'all' returns every source (legacy CSV + Schwab lot-match). 'trusted' filters to Schwab lot-match only. Default 'all' until Schwab ingest replaces legacy CSV as the primary source.
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/position-mgmt/strategy/live

Get Live Strategy

Sharpe / Sortino / drawdown / win-rate analytics on realized_trades.

Default and effective source policy excludes csv_upload and orphan rows, so KPIs reflect only broker-verified closed lots.

Filtering precedence: when year is supplied, uses the explicit year range (optionally narrowed by month); otherwise falls back to rolling days.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
daysqueryintegeroptional
yearquery—optional
monthquery—optional
symbolquery—optional
source_policyquerystringoptional'trusted' = only broker-persisted Schwab FIFO matches. Legacy/all values are accepted as trusted aliases.
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/recommendations

Get Recommendations

Parameters

NameInTypeRequiredDescription
statusquerystringoptional
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/recommendations/generate

Generate Recommendations

Run NBA engine from stored signals and cached quote snapshots.

signals_considered and from_signals count only signals visible to the authenticated member. Signals on symbols watched only by another tenant member are excluded, and a symbol you request explicitly that only another member watches is answered exactly like a symbol nobody watches: the counts, reason and every other field are identical.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/recommendations/history

Recommendation History

Parameters

NameInTypeRequiredDescription
daysqueryintegeroptional
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

PATCH /api/trading-intel/recommendations/{rec_id}/ack

Ack Recommendation

Parameters

NameInTypeRequiredDescription
rec_idpathintegerrequired
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/risk

Get Portfolio Risk

Portfolio concentration + volatility risk analysis with HHI.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/risk/portfolio-metrics

Get Risk Portfolio Metrics

Sharpe, Sortino, max drawdown, CAGR, win rate, profit factor.

CAGR contract : cagr is derived only from portfolio_daily_facts.portfolio_value. Realized-trade rows still drive trade metrics, but never CAGR. At least 365 calendar days of positive snapshot history are required ; shorter windows return cagr=None and report total_return and history_days over the window instead. Endpoints are complete dates only : snapshots are summed per date across accounts, one row per account (the newest if a snapshot was stored twice). A date is an endpoint only when its account count equals the highest count among the dates within 3 days either side, so a partial sync is skipped while a newly opened or closed account is accepted after 3 days. total_return, history_days and cagr are measured between those endpoints.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
daysqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/scanner

Get Scanner

Market scanner — returns symbols matching the requested scan type.

Parameters

NameInTypeRequiredDescription
scan_typequerystringoptionalTOP_GAINERS
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/sentiment/{symbol}/synthesis

Get Sentiment Synthesis

Parameters

NameInTypeRequiredDescription
symbolpathstringrequired
force_refreshquerybooleanoptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/signals/refresh-market-wide

Refresh Market Wide Signals

Queue ML forecast generation for a market universe.

Returns immediately; forecasts run in the background. New signals appear in the pre-market gameplan within 1–3 minutes.

Parameters

NameInTypeRequiredDescription
universequerystringoptionalportfolio
account_idquery—optional
return_pct_thresholdquerynumberoptionalMin absolute predicted return %% to generate a signal
limitqueryintegeroptionalMax symbols to process in this run (1–50)
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/ta/analyze

Get Ta Analysis

Full technical analysis for a symbol.

Fetches OHLCV (yfinance primary, Alpaca fallback) and computes: RSI(14), MACD(12/26/9), SMA(20), SMA(50), Bollinger Bands(20,2), VWAP.

Also returns:

  • Recent news/events from market_intel for the symbol
  • Existing intraday AI signals for the symbol (existing_signals is empty when only another tenant member watches the symbol)
  • Live market index quotes (SPY, QQQ, DIA, ^VIX) for macro context

Set include_context=false for chart-only requests. This preserves bars, indicators, and tenant-scoped signals while skipping news, macro quotes, options-chain analysis, and company, warehouse, and calendar enrichment.

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol, e.g. AAPL
intervalquerystringoptionalBar interval: 1m 5m 15m 30m 1h 1d 1wk
periodquerystringoptionalLook-back period: 1d 5d 1mo 3mo 6mo 1y 2y 5y
include_contextquerybooleanoptionalInclude news, macro, options, and company context. Defaults to true.

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/ta/ask

Ta Ask

Ask Claude a free-form question about a symbol using live market context.

Accepts optional pre-fetched context (indicators, news, market_indices, bars_tail) to avoid a duplicate yfinance call when the frontend already has the data loaded. If not provided, falls back to a fresh fetch.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/ta/chart

Get Ta Chart

OHLCV bars formatted for lightweight-charts (time = Unix seconds).

Returns a minimal payload suited for charting: no indicators, no news. Use /ta/analyze for the full analysis payload.

Provider selection is limited to implemented providers. Future provider stubs are not callable so the UI never sees a 501 for a selectable row.

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol, e.g. AAPL
intervalquerystringoptionalBar interval: 1m 5m 15m 30m 1h 1d 1wk
periodquerystringoptionalLook-back period: 1d 5d 1mo 3mo 6mo 1y 2y 5y
providerquerystringoptionalData provider: auto

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/ta/ml-forecast

Get Ml Forecast

ML-powered 5-day price target range.

TA-031: Trained models are persisted to disk and reused for <200 ms warm-path responses (cache TTL = 24 h, keyed by symbol + interval + feature_version).

TA-030: Pass features=extended to enable VP / FVG / sweep-distance features. Extended features are also gated by the user pref ml_extended_features (default false); both conditions must be true.

Trains a Random Forest Regressor on the requested OHLCV history using lagged returns + RSI / MACD / Bollinger Bands / VWAP / volume features. Returns target_low / target_high (±1σ tree spread) and a confidence score derived from test-set R² and prediction-interval tightness.

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol, e.g. AAPL
intervalquerystringoptionalBar interval: 1d 1wk (daily recommended for RF)
periodquerystringoptionalLook-back period: 3mo 6mo 1y 2y
featuresquerystringoptionalTA-030: Feature set. 'baseline' (default) uses OHLCV + TA indicators. 'extended' adds VP distances + FVG zone + sweep features. Extended features also require the user pref ml_extended_features=true.
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/ta/options-payoff

Compute Options Payoff

Compute expiry P&L payoff for a portfolio of option contracts.

Returns 120-point price curve, max profit/loss, breakevens, and current PnL. Values are per strategy (quantity × 100 shares per contract).

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/ta/providers

List Ta Providers

List all registered OHLCV providers and whether their credentials are set.

Responses

CodeDescription
200Successful Response

GET /api/trading-intel/timing

Get Timing Insights

Return timing insights derived from signal generation patterns.

Parameters

NameInTypeRequiredDescription
account_idquery—optional
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/trade-quality

Get Trade Quality

Parameters

NameInTypeRequiredDescription
account_idquery—optional
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/trading-intel/volume/detect

Detect Volume

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/trading-intel/volume/signals

Get Volume Signals

Parameters

NameInTypeRequiredDescription
limitqueryintegeroptional
tenant_idquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

Occasional BlitzPulse product updates and offers, sent only if you tick the box and confirm your address.

How we handle your email

Footer Disclaimer BlitzPulse is educational decision support only. Not investment, tax, or legal advice. Not a broker. Trade at your own risk.