entry to exit.
every trade passes through eleven stages before it closes. four ai layers, three risk layers, four exit legs, and a live regime re-check. each rejection point is shown — silent failures are not part of the design.
A new OHLCV frame arrives from the broker feed for an instrument inside an active S1–S6 config. The feed is normalized across brokers and timestamped to the script timeframe.
- broker feed (websocket)
- active config registry
- tf-aligned clock
- normalized frame
- rolling window update
The frame is run through the four alpha driver engines (TRND · BRK · MR · SWP) and the 17 subsystems specific to that script. Each engine computes its own candidate trade — only one engine carries the trade forward (engine attribution is preserved end-to-end).
- normalized frame + rolling window
- subsystem state (filters, structure, exhaustion)
- active parameter set (from latest manifest)
- candidate trade
- engine attribution tag
- subsystem stack record
- ≥1 engine produces a non-null candidate
- subsystem stack consensus ≥ threshold
- no overlap with an active position on the same instrument
The candidate is scored by a gradient-boosted classifier trained on the calibrated cohort. Output is a probability of profitable resolution given the feature stack (engine, subsystem outputs, recent regime).
- candidate trade + feature vector
- probability score [0,1]
- model confidence band
- score ≥ engine-specific threshold
- confidence band within tolerance
A FinBERT-derived sentiment score is computed against the streaming news flow for the instrument and its correlated peers. The gate blocks trades that conflict with the prevailing sentiment regime — e.g. fading a strong narrative without a regime-aligned reason.
- news + macro feed window
- instrument + peer correlation map
- sentiment alignment score
- block/allow decision
- alignment score within engine tolerance
- no active blackout headline
The active regime (computed from rolling features) is matched against the regime profile that calibrated this parameter set. Out-of-distribution regimes block the trade even when statistical edge is intact.
- active regime vector
- calibration regime fingerprint (per-config)
- regime match score
- block/allow decision
- match score ≥ regime threshold
The volatility PDE classifier computes the active Λ-Vol state from four features (level · slope · dispersion · velocity) and maps the candidate to one of five states: TREND_CALM · TREND_ACTIVE · MEAN_REVERT · STRESS_HIGH · TRANSITION. Only state-compatible engines are allowed through.
- Λ-Vol feature vector
- engine ↔ state compatibility matrix
- active Λ-Vol state
- engine compatibility verdict
- engine permitted in current state
- no STRESS_HIGH veto on directional engines
The approved trade is sized through three risk layers. ELU = Margin% × Leverage × SL% / 100 is computed at the per-trade layer and aggregated upward. Order-flow quality at the moment of placement maps continuously to leverage — thin books reduce size, deep books permit standard sizing.
- account state
- session ledger
- portfolio exposure
- live order-flow snapshot
- position size
- leverage
- stop-loss / take-profit anchors
- ELU value
- per-trade ELU ≤ trade ceiling
- per-session aggregate ELU ≤ daily ceiling
- portfolio correlation budget not exceeded
The order is routed through the OMS to the broker, with retry logic on partial fills and slippage capture. The position record is created with engine, subsystem stack, AI scores, and Λ-Vol state stamped — every piece of context that informed the entry is preserved for attribution.
- sized order
- broker route
- slippage / commission profile
- confirmed fill(s)
- position record (entry context attached)
- live mark-to-market hook
While the trade is open, the regime is re-checked on every new frame. A regime shift mid-trade can override the exit ladder (early exit) — this is the system's primary defense against held-through-a-state-change risk. The 4 AI layers continue to monitor; an out-of-distribution regime triggers a managed exit.
- new frames
- running mark-to-market
- running Λ-Vol state
- mark-to-market updates
- regime-shift alerts
- managed-exit triggers
The position unwinds in four legs at engine-specific allocations. Targets are anchored to entry-time volatility; the runner is trailed by the live Λ-Vol envelope. A regime-shift override collapses the ladder into an immediate exit at whichever leg is next.
- entry anchors
- live volatility envelope
- regime-shift signal (if any)
- partial fills at P1, P2, P3, P4
- realized P&L per leg
- exit-reason tag per leg
The closed trade is written to the manifest with full attribution: engine, subsystem stack, AI 1–4 scores at entry, Λ-Vol state at entry and exit, leg-by-leg P&L, slippage and commission. Drift detection compares live edge against the cycle baseline; persistent drift triggers the next R-PRISM cycle.
- closed trade record
- live cohort vs cycle baseline
- manifest entry
- attribution row
- drift signal (if any)
- manifest write succeeded
- attribution decomposition sums to total P&L