AI Investor

Home
Timeline
Trades
Social & News
Blocked Trades
Ratings
Performance
Signals
Scanners
Autopilot
Strategy Lab
Strategies
Replays
Decision Review
Config
Prompts
Docs
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Recent Rating Warnings

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How replays work

Loading strategy summary...

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

How AI Investor Works

AI Investor is an autonomous options and equity trading system. External feeds, scanners, signal files, scheduled research jobs, and rating passes create normalized candidates; the dispatcher applies global safeguards and structure-specific order gates before anything reaches Alpaca. Alpaca trade updates, SIP/OPRA quotes, OPRA option prints, and symbol-scoped news now share the MarketDataStream infrastructure with durable connection observability, while long-running dashboard and runtime work is backed by job_queue rows and bounded read models.

Signal Sources (Trade Triggers)

Trades can be initiated from any of the following sources. Each source produces a candidate signal that must pass the same execution boundary before an order is submitted.

Truth Social / X Stream

Monitors configured social accounts. After-hours items become durable replay rows and are re-analyzed with fresh prices at the next market open.

RSS / News Feeds

Polls macro, international, and SEC feeds. EDGAR items are enriched before classification, and feed outcomes are written through the current feed/signal schema.

Alpaca News

Optional REST poller for explicit watchlist symbols. Cursors, overlap windows, persistent dedupe, and article-text limits keep it useful without becoming an all-news firehose.

Congressional Trades

Uses Quiver disclosures when configured. New disclosures enter the same news-trader classification and execution flow as other external event feeds.

Options Flow Scanner

REST fallback scans every 15 minutes. The optional OPRA stream shadows real-time option prints into scanner telemetry with bounded subscriptions and coalesced trade bursts.

Options Value (Historical)

Retired scanner source. Historical observations, outcomes, and decision-review rows remain available for research, replay, and calibration.

Signal Watcher (File Drop)

Watches data/signals/ for schema-validated JSON files. Stale-but-usable files are revalidated before execution; terminal files move to processed/ or failed/.

Scheduled Runtime Jobs

Durably schedules the morning briefing, investor runs, hourly feedback, tail-hedge checks, daily reports, maintenance, and active options research jobs. Retired Autopilot/extinction history remains visible separately.

Value Investor

Fundamental-driven system using moat analysis, asset-aware valuation, thesis kind caps, and LEAPS entries (270730 DTE) when allocation and margin-of-safety rules pass.

Rating Scheduler / Advisory

Continuously refreshes ratings, analyst reviews, ETF sector rows, and automated rating signals. Trade-time advisories are non-blocking warnings, not order vetoes.

Gate Pipelines

Risk-increasing orders use declarative gate arrays in src/execution/orderGates/. Gates run in order through runGatePipeline(); the first failure blocks the entry and records the reason. Closing orders and protected short-leg follow-ups use narrower paths.

Single-Leg Options (29 gates)

1

Limit Price Required

Risk-increasing orders require a positive limit price so dollar-based safeguards have a real cost basis.

2

Market Hours

Blocks entries outside regular hours unless the caller has already verified hours.

3

Cooldown

Per-underlying cooldown (currently ? min). Bypassed by high-impact signals.

4

Contract Availability

Confirms the OCC contract is currently available from the option-chain provider before any order is built.

5

Bid/Ask Spread

Rejects stale or too-wide option quotes using caller-provided, stream-cached, or snapshot contract quality data.

6

Minimum Open Interest

Blocks illiquid contracts when open interest is missing or below the configured quality floor.

7

Position Limit

Checks open exposure and drawdown-adjusted limits. Bypassed by high-impact signals.

8

Rating Recommendation

Applies hard rating-recommendation blocks when a configured rating signal says the proposed direction is not allowed.

9

Value Pre-Trade

Only runs for value-investor entries; checks value allocation and per-position caps.

10

Directional Exposure

Checks net bullish/bearish exposure and can evaluate a rotation directive before rejecting. Bypassed by high-impact signals.

11

Recent Opposing Event Signal

Blocks event-risk entries when a recent same-category signal points the other way for the underlying.

12

Gross Long Premium Cap

Caps total long-option premium so the book cannot stack theta bleed on both sides. Bypassed by high-impact signals.

13

Sector Concentration

Sector notional cannot exceed ?% of portfolio. Bypassed by high-impact signals.

14

Earnings Proximity

Blocks naked long options inside the configured pre-earnings window (currently ?d when enabled).

15

Corporate Action

Blocks contracts whose underlying has a nearby split, merger, or other corporate-action risk.

16

Thesis Horizon

Shadow/enforce gate comparing expectedThesisHorizonDays against DTE for external analysis and scanner signals.

17

Event-Risk Single Leg

For abrupt news categories, rejects naked single-leg exposure and asks for a defined-risk debit spread instead.

18

Require Spread Structure

Legacy shadow/enforce gate that forces a debit vertical when pricey premium and long runway make a naked long structurally weak. Mutually exclusive with the newer vol-surface gate.

19

Naked Short Check

Prevents selling unprotected short options.

20

PDT Rule Check

Protects against pattern day trader violations.

21

Option Buy Expectancy

Rejects long-premium buys when the volatility regime makes expectancy unfavorable.

22

Buying Power

Verifies account buying power before the broker sees the order.

23

Max Trade Dollars

Caps per-trade dollars after sizing multipliers and small-account single-contract rules.

24

Spread Leg Conflict

Blocks buying a leg that is currently the short leg of an open spread.

25

Loss Cooldown

Blocks re-entry after a recent realized loss. Bypassed by high-impact signals.

26

Duplicate Position

Blocks doubling into an already-open option symbol.

27

Moneyness Quality

Rejects deep-OTM lottery tickets and deep-ITM contracts with poor leverage.

28

High IV / Vol Surface

Uses either the legacy high-IV regime gate or the vol-surface gate, depending on feature flag state. High-impact signals bypass the legacy IV path.

29

Source Concentration

Caps exposure by originating signal source. Bypassed by high-impact signals.

Spread Orders (23 gates)

1

Market Hours

Same market-hours boundary as single-leg orders.

2

Cooldown

Primary-underlying cooldown. Bypassed by high-impact signals.

3

Contract Availability

Confirms all spread legs are available from the option-chain provider.

4

Bid/Ask Spread

Checks quote quality across all legs before sizing risk.

5

Minimum Open Interest

Rejects spreads whose legs do not meet the open-interest floor.

6

Position Limit

Open exposure check, including drawdown and macro-regime adjustments. Bypassed by high-impact signals.

7

Rating Recommendation

Applies hard rating-recommendation blocks to spread entries when configured.

8

Value Pre-Trade

Value allocation guard for value-investor spread entries.

9

Sector Concentration

Same sector concentration guard as single-leg entries. Bypassed by high-impact signals.

10

Earnings Proximity

When enabled, blocks directional spread entries inside the pre-earnings window.

11

Corporate Action

Blocks spread legs exposed to nearby split, merger, or other corporate-action risk.

12

Thesis Horizon

Compares the expected thesis horizon to the shortest leg DTE.

13

Spread Directional Exposure

Infers bullish/bearish bias from structure family and checks the corresponding exposure cap, including rotation-aware retry.

14

Recent Opposing Event Signal

Blocks event-risk spreads when a recent same-category signal points the other way for the underlying.

15

Spread Risk Sizing

Computes max loss once and rejects unsupported structures or non-positive risk.

16

Minimum Capital At Risk

Rejects spreads too small to be worth commissions and slippage.

17

Minimum Spread Width

Blocks spreads narrower than the configured acceptable risk/reward width.

18

Source Concentration

Caps exposure by originating signal source. Bypassed by high-impact signals.

19

Buying Power

Checks buying power against max loss for the spread.

20

Max Trade Dollars

Caps per-trade dollars after spread risk sizing and effective multipliers.

21

Spread Leg Conflict

Checks buy legs against existing spread shorts.

22

Loss Cooldown

Blocks re-entry into a recently losing underlying. Bypassed by high-impact signals.

23

Duplicate Position

Blocks a second spread on the same primary symbol.

Protected Short Leg (3 gates)

Used only when the system sells the short leg after the protective long leg has filled.

1

Protected Vertical Pair

Verifies same underlying, same expiration, same option type, different strikes, and expected structure family.

2

Market Hours

Same market-hours boundary.

3

Broker State Check

Confirms the long order filled, the protective long position exists, and the short leg is not already open.

High-Impact Bypass

High-impact signals can bypass routine portfolio-friction gates: cooldown, position limit, directional exposure, gross long premium cap, sector concentration, loss cooldown, legacy IV regime, and source concentration. Price, market-hours, contract availability, contract quality, rating hard-blocks, recent opposing event signals, earnings, corporate actions, thesis-horizon, spread-structure, naked-short, PDT, expectancy, buying-power, max-trade, duplicate, and broker-state checks remain hard boundaries.

Safeguards (Circuit Breakers)

Global safeguards run before and around the gate pipeline. They persist cooldowns, daily counters, PDT state, circuit-breaker state, and pending-trade locks so restarts do not forget risk state.

Daily Loss / Drawdown

Daily loss halts at ?%, while 30-day drawdown halts at ?% and scales sizing before the halt.

Daily Trade Count

Caps new trades at ? per day, with high-impact carve-outs only where the caller explicitly allows them.

Pending Trade Lock

Atomic underlying locks prevent two sources from opening overlapping entries at the same time. Stale locks are discarded only after the configured timeout.

Small Account Floor

Single option contracts may exceed the normal cap on small accounts only when under the single-contract percentage guard.

Exit System

Open positions are monitored continuously. Entry, retry, partial-exit, grouped-exit, and pending-exit paths share duplicate-submission guards, fill tracking, and startup reconciliation so lost timers do not hide broker state. When Alpaca streams are enabled, fresh position quotes can also trigger min-spaced exit evaluation instead of waiting for the next two-minute exit-monitor tick.

Stop Loss

Closes when unrealized loss exceeds ?%.

Take Profit

Closes when unrealized gain reaches ?%.

Partial Profit

Sells a portion at ?% while tracking the remaining quantity.

Theta Stop

Exits stagnant long-premium positions after theta loss reaches ?%.

Trailing Stop

After a position becomes profitable, exits on a ?% retrace from peak profit.

Seller Profit

Credit spreads close after ?% of max premium has been captured.

Rotation Close-Then-Enter

When enabled, a blocked entry can close specified losing positions first, wait for fills, then submit the new trade with the same audit chain.

Dashboard Control Plane

Auth & Binding

Loopback remains local-friendly. Non-loopback binds require both DASHBOARD_VIEWER_TOKEN and DASHBOARD_ADMIN_TOKEN; GET routes accept viewer/admin tokens, mutations require admin.

Config Overrides

The Config tab validates against CONFIG_PARAMS, persists overrides to KV, and reloads tunable values at runtime for loops that use runPeriodicLoop().

Durable Jobs

Manual rating runs, analyst reviews, scheduled briefings, reports, tail hedges, and maintenance use job_queue for idempotency, status, attempts, locks, and errors.

Stream Observability

Alpaca trading, SIP, OPRA, and news sockets report connect/disconnect events, lag, message counts, subscriptions, dropped messages, and restart state through runtime health and durable stream event tables.

Read Models

High-volume dashboard routes use readonly helpers, keyset pagination, bounded limits, and query modules instead of ad hoc writable reads.

Maintenance Banner

The dashboard polls /api/maintenance; expired flags auto-clear so stale warnings do not linger after backfills.

Secrets Status

The Config tab reports whether required and optional credentials are configured without returning secret values.

Aggression Slider

The aggression slider (1–10) scales risk parameters exposed in the Config tab: position sizing, daily limits, drawdown, exits, order gates, and scanner behavior. Manual overrides can still pin individual values after the slider computes the baseline.

Feed Outcomes

External feed rows and linked signal rows can surface these outcomes:

TradedSignal passed execution and an order was placed
Deferred / QueuedSignal is waiting for market-open review or deferred execution
Not RelevantClassifier found no actionable trade signal
Low QualityTradeable idea was too weak, stale, or ambiguous
Safeguard BlockedSignal was valid but a safeguard or gate blocked execution
DuplicateSignal duplicates an existing or recently processed idea
Tape Conflict / ErrorMarket tape contradicted the thesis, or processing failed

Valuation System

Ratings now use an asset-aware valuation dispatcher. Generic equities use a multi-method composite; banks and utilities use sector-native engines; selected sector ETFs receive directional ETF rows; unsupported assets remain visible without pretending they have a Buffett-style intrinsic value.

Valuation Engines

Generic Equity Composite

DCF V2, EPV, EV/EBITDA, PEG, plus optional Price-to-Sales and Book-Floor fallback methods for money-losing names. One-method composites are allowed only when configured and confidence-capped.

Bank Native

Fair price-to-book, residual income, and peer P/E methods with bank-specific leverage and stress overlays. Tier-1 confidence is capped until richer bank data arrives.

Utility Native

Regulated earnings, fair P/E, and dividend-anchor methods tuned for rate-base businesses where generic DCF is a poor fit.

ETF Directional

Select Sector SPDR rows use ETF momentum, relative strength versus SPY, and live macro context. ETF labels are capped at BUY/NEUTRAL/SELL until look-through fundamentals ship.

Analyst Review

Optional Sonnet analyst reviews can supply a credible fair-value anchor. DeepSeek can run beside Sonnet as an informational second opinion without changing effective valuation.

Unsupported Cases

Real Estate and development-stage biotech can intentionally return no composite. Narrative/speculative theses remain informational with conviction caps.

Generic Composite Weights

Core weights shrink when fallback methods are enabled so P/S and Book-Floor can contribute without changing the total weight. Contributing methods are re-normalized at read time.

TierDCFEPVEV/EBITDAPEGP/SBook
Cyclicals17%34%21.3%12.8%10%5%
Steady Growers29.8%12.8%21.3%21.3%10%5%
Default21.3%21.3%21.3%21.3%10%5%

Confidence Score (0–100)

Generic confidence still combines input completeness, method agreement, sector applicability, and a market-disagrees penalty. New caps prevent false precision: single-method composites cap at 35, fallback-only composites cap at 40, and extreme method divergence caps confidence at 35 or 50.

Value Investor Pipeline

The value system screens fundamental candidates for long-duration entries. It combines moat analysis, asset-aware valuation, margin of safety (currently ?%), conviction (minimum ?), thesis kind, analyst review, and portfolio allocation limits. LEAPS entries use 270730 DTE, target delta 0.85, and max 15% extrinsic.

Rating Scheduler

The scheduler runs every 60 minutes with batch size 2 and 34% random sampling. It prioritizes held positions, recent trades, pending signal tickers, stale rows, sector rotation, and unrated samples. Productive slots are refilled when a ticker has no financials, is filtered, or errors. Manual dashboard rating and analyst-review actions enqueue durable jobs instead of doing long work in the request. Ratings older than 10 days are refreshed, and automated rating labels are computed at dashboard read time with model/confidence metadata.