Repository navigation
Releases
v1.3.1 — Pattern contract recommendation reworked
Changed
- Pattern Scanner contract recommendation, reworked. For each pattern, the scanner now recommends the single best payoff-per-dollar contract within a 0.40–0.50 delta, 25–30 DTE band — the option that gains the most relative to its cost if the pattern reaches its measured-move target. Replaces the old ATM-at-breakout / nearest-default-DTE pick. Falls back to the closest listed contract (and says so) when nothing is exactly in-band.
- Consistent and always actionable. The inline "Contract" panel and the click-in chart modal share the same recommendation and highlight the same contract in the chain. The panel shows what the pattern implies for the move (entry → target) plus that contract's take-profit / stop-loss.
- No more "moved out of position" dead-ends. A played-out (stale) setup re-anchors to a fresh entry at the current price toward the pattern's projected target, clearly flagged in the UI, instead of showing nothing.
210 tests passing (4 new). Full notes in CHANGELOG.md.
v1.3.0 — Pattern backtest + optimizer
Added
- Pattern Scanner options backtest + optimizer. A new Backtest tab inside the Pattern Scanner replays the detectors over history: every time a pattern fires it simulates buying an option (your target delta + DTE) and selling it after N candles, then reports win rate, return, expectancy, and P&L by pattern. Optimize sweeps delta × DTE × hold and ranks every combination so you can see which option to buy and how long to hold. Prices off real historical option fills by default (the data plan exposes intraday option aggregates, confirmed live); BSM is a fast fallback.
- Options Screener + Options-Strategy Backtest run off any portfolio or watchlist via a combined picker.
Changed
- "Sleeve" → "Portfolio" across all remaining visible labels (Backtest + Options tabs, attribution/trade columns, empty states). API routes, types, and config keys unchanged.
- Market News "Your book" feed = portfolio holdings only.
Fixed
- Options Screener / backtests no longer error after you rename your portfolios — they seed to your first real portfolio instead of a hardcoded name.
start-backend.batnow auto-clears any stale instance on port 8000 before starting, preventing process pile-up / "address in use".
206 tests passing (11 new). Full notes in CHANGELOG.md.
v1.2.0 — Trade plans on the options play, Today's plays, reliability pass
Risk-managed trade plans on the Pattern Scanner's options plays, a freshness-first scanner workflow, per-sleeve agent runs, and a reliability pass on quotes and intraday data. 195 tests passing.
Signals only — no trading execution. Alpha Terminal generates ideas; you decide what to do with them.
🎯 Trade plans — on the options play
Click any pattern and Signal Analysis builds a concrete plan for the play's contract (ATM call/put at the breakout, expiry suited to the scan timeframe):
- Buy / cut / take-profit premiums via Black-Scholes at the contract's IV, anchored to the live market mid, with the expected hold's theta priced into the target
- Risk tolerance × volatility: Conservative / Moderate / Aggressive sets the underlying stop at 1.0× / 1.5× / 2.5× ATR — wider stops on jumpy names, tighter on calm ones
- Theta viability guard: when decay outruns the measured move, a longer expiry is tried automatically; if nothing clears, the card says "not viable as a long option" instead of showing a take-profit below entry
- Signal actionability gating: every plan is classified LIVE / WATCH / STALE against current price — no more premium plans on setups that already hit target or breached their stop
- Position sizer in contracts (account $ + risk % → count, premium outlay, max loss)
🔎 Pattern Scanner workflow
- "Today's plays" default sort — freshest breakouts first, ranked by confidence within each day, grouped under day separators with counts
- Filter chips: recency (Today/3d/1w/1mo), minimum confidence, bullish/bearish bias
📊 Portfolio Pulse
- Per-sleeve "Run agents" — scan one sleeve on demand; results merge into the day's saved scan instead of replacing it
- Saved analyses (per-ticker scans, theses) persist across refresh and restart
🛡 Reliability
- Quotes: last-known-good semantics — a slow provider now means slightly-stale prices, never blank dashes (failures were previously cached as nulls)
- Intraday charts: Polygon's pagination cursor is now followed, fixing charts that froze mid-history on heavily-traded names (NVDA 1h stopped ~2 weeks back); hourly bars now include the 09:00 bar containing the market open; truncated provider responses are never cached
- Forced dark theme; 3×2 left-nav grid; watchlist save fixes; one-click
start-backend.bat
Full details: CHANGELOG.md
v1.1.0 — P&L Tracker, Fidelity import, intraday Pattern Scanner
A new P&L tab, intraday pattern scanning, and a production-hardening pass driven by a full backend + frontend audit. 172 tests passing.
Signals only — no trading execution. Alpha Terminal generates ideas; you decide what to do with them.
💰 P&L Tracker (new tab)
- Track contracts you take or find attractive: manual entry (stocks + options, long/short, paper vs real) and a one-click ➕ Track button on every option-chain row (1 contract at the live mid).
- Fidelity CSV import — both export flavors (Positions and Activity). Compact option symbols (
-NVDA260717C200) decoded, opening fills create positions, closing fills FIFO-match with correct partial-close splits, and re-imports are idempotent. The raw CSV is never persisted. - Live mark-to-market: chain-snapshot mid → last trade → day close, with a per-contract aggregate fallback after hours; stocks at the latest close.
- Realized / unrealized / total P&L, win rate, per-underlying rollup, and a realized equity curve. Close any position at the prefilled current mark.
- docs/FIDELITY_INTEGRATION.md documents the SnapTrade (Akoya OAuth) auto-sync upgrade path — and why stored-credential scraping is deliberately not supported.
🔎 Intraday Pattern Scanner
- All 12 chart-pattern detectors now run on 1-hour and 15-minute bars alongside daily, with a timeframe toggle and per-timeframe lookbacks.
- Intraday bars are regular-trading-hours only (premarket noise filtered) and read in US-Eastern exchange time on charts and signals.
- Historical win-rate thresholds scale with bar size (3% daily / 1.5% hourly / 0.75% on 15m over 20 bars) so "win" stays meaningful.
🛡 Production hardening
- Fixed an API-key log leak: the pattern data client passed the Polygon key as a URL query param, which httpx logged on every request. Now Bearer-header auth + httpx/httpcore capped at WARNING + sanitized errors + transient-timeout retry.
- Fixed a stale-closure bug and added a 5-minute SSE inactivity watchdog so a stalled backend can no longer leave the scan UI on "running" forever.
- Fixed a chat-context crash, unblocked the event loop in the sleeves-backtest pre-flight, made corrupt scan files degrade gracefully (422 + fallback), made watchlist writes atomic + validated.
- Removed 46 dead frontend files, consolidated the API base URL (was 22 hardcoded literals), and replaced every
alert()/confirm()with sonner toasts.
Full history: CHANGELOG.md
v1.0.0 — Alpha Terminal (first stable release)
First stable release. The five-tab dashboard (Market · Screening · Portfolio · News · Calls) is feature-complete and tested (156 passing), the internals have been cleaned up and documented, and the API/UI surface is considered stable.
Signals only — no trading execution. Alpha Terminal generates ideas; you decide what to do with them.
Added
- Per-name conviction score + recommendation in Portfolio Pulse — an overall call (Strong Buy → Strong Sell) and a 0–100 conviction score derived from the signed weighted agent blend, shown as a row pill and a headline verdict card.
- Startup configuration check — a loud, actionable warning when
DEEPSEEK_API_KEYor a market-data key is missing, so a misconfigured install fails visibly instead of silently degrading to "no edge".
Changed
- Extracted the options scoring engine out of the 5,463-line
sleeves.pyintoapp/backend/services/options_scoring.py. The route file is now ~3,360 lines focused on HTTP; the registered route surface is byte-identical and all 156 tests pass. - Consolidated runtime user state under
app/data/, with a read-only fallback to the legacy path so existing installs keep their watchlists. - Rewrote the Pattern Scanner docs to match the platform (12 detectors, the
0.4·breakout + 0.3·volume + 0.3·touchconfidence blend, chart overlays, 730-day win-rate, graded options plays). - Replaced the stale upstream
app/README.mdand fixed the API-key hints in the run scripts; refreshed the app identity and module docstrings.
Fixed
- Fundamentals & Valuation analyst rendering — their structured-dict
reasoningpreviously rendered as[object Object]; it now shows each category (profitability, growth, financial health, price ratios) as a labeled, signal-colored row.
Removed
- Pruned orphaned frontend files with zero importers (
portfolio-pulse-header.tsx, thestocks/directory) and a no-op dead-code branch in the sleeves backtest.
Full history: CHANGELOG.md
v0.1.0 — Alpha Terminal
First public release of Alpha Terminal — a retail-investor research dashboard built on top of virattt/ai-hedge-fund (MIT). Signals only; no trade execution.
Highlights
🎯 Sleeves dashboard — Themed portfolio buckets (Mega Tech / Energy Transition / Emerging Tech / Opportunistic), each scored by its own LLM agent panel. Click any ticker for inline expansion with 2-year price chart (with 1W / 1M / 3M / 6M / YTD / 1Y / 2Y timeframe selector), 2-sentence company overview, full key financials grid, and per-agent thesis breakdown. One-click LLM PM-memo synthesis at portfolio + sleeve scope.
📈 Options screener — 11 strategies (Weakness / Strength / Momentum / Mean Reversion / Breakout / Breakdown / Volume Spike / Pullback / Trend Bias / Vol Expansion / Unusual Options Activity). Per-strategy strike + expiry recommendation that adapts to your picked expiry via √-time strike scaling.
🧪 Backtest engine — Two pricing modes: real Polygon historical fills OR Black-Scholes proxy. Per-contract drawdown stop-loss (off / -25% / -40% / -50% / -75%). Plus a Sleeves backtest mode that wraps the LLM agent panel as the per-day decision layer.
📊 My Stocks dashboard — Editable list with per-card persistent timeframe selector. Each card remembers its own window.
🛠 Three custom agents — alpha_seeker (sector-agnostic), energy_transition (IRA + FEOC scorecard), emerging_tech (moat + S-curve + AI tailwind).
🔀 Per-data-type provider routing — Prices + news + market cap → Polygon (broad coverage). Fundamentals → FDS (ratios). Bidirectional fallbacks so single-provider setups still work.
Code quality
- 108 tests passing
- Frontend
tsc --noEmitclean - Error boundary catches per-tab crashes
- Comprehensive docs: README (retail audience), ARCHITECTURE (contributors), ATTRIBUTION (upstream credit), CONTRIBUTING
Setup
See README.md → Quick start. Minimum viable setup: Polygon Stocks Advanced + DeepSeek API key. Optional add-ons: Polygon Options Developer (for real-fill backtest), financialdatasets.ai (for richer ratios on small caps).
License
MIT. Built on virattt/ai-hedge-fund, also MIT. See ATTRIBUTION.md for the full diff of inherited vs new code.