αQuant7Alpha
end-to-end trade flow · eleven stages

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.

end-to-end trade flow11 stages · entry → exit
STAGE 01Market Tick

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.

inputs
  • broker feed (websocket)
  • active config registry
  • tf-aligned clock
outputs
  • normalized frame
  • rolling window update
frame committed
STAGE 02Engine & Subsystem Evaluation

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).

inputs
  • normalized frame + rolling window
  • subsystem state (filters, structure, exhaustion)
  • active parameter set (from latest manifest)
outputs
  • candidate trade
  • engine attribution tag
  • subsystem stack record
gates
  • ≥1 engine produces a non-null candidate
  • subsystem stack consensus ≥ threshold
  • no overlap with an active position on the same instrument
REJECTNo engine fires or subsystems disagree → frame is logged and discarded. The trade flow stops here for this tick.
candidate trade
STAGE 03AI 1 · XGBoost ML Classifier

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).

inputs
  • candidate trade + feature vector
outputs
  • probability score [0,1]
  • model confidence band
gates
  • score ≥ engine-specific threshold
  • confidence band within tolerance
REJECTScore below threshold → trade dropped. Logged for offline analysis only.
passes layer 1
STAGE 04AI 2 · FinBERT Sentiment Gate

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.

inputs
  • news + macro feed window
  • instrument + peer correlation map
outputs
  • sentiment alignment score
  • block/allow decision
gates
  • alignment score within engine tolerance
  • no active blackout headline
REJECTSentiment misalignment → trade dropped. Audit trail records the headline cohort that triggered the block.
passes layer 2
STAGE 05AI 3 · Regime Match Classifier

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.

inputs
  • active regime vector
  • calibration regime fingerprint (per-config)
outputs
  • regime match score
  • block/allow decision
gates
  • match score ≥ regime threshold
REJECTOut-of-distribution regime → trade dropped. RX cycle is notified to track regime drift.
passes layer 3
STAGE 06AI 4 · Λ-Vol Regime Intelligence

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.

inputs
  • Λ-Vol feature vector
  • engine ↔ state compatibility matrix
outputs
  • active Λ-Vol state
  • engine compatibility verdict
gates
  • engine permitted in current state
  • no STRESS_HIGH veto on directional engines
REJECTEngine not permitted in current state → trade dropped. Drives a Λ-Vol-state attribution row in telemetry.
approved trade
STAGE 07Dynamic Risk Profiling

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.

inputs
  • account state
  • session ledger
  • portfolio exposure
  • live order-flow snapshot
outputs
  • position size
  • leverage
  • stop-loss / take-profit anchors
  • ELU value
gates
  • per-trade ELU ≤ trade ceiling
  • per-session aggregate ELU ≤ daily ceiling
  • portfolio correlation budget not exceeded
REJECTAny of the three risk ceilings breached → trade is rejected entirely (no down-sizing fallback). Session circuit breaker may trip.
sized order
STAGE 08Order Placement & Position Open

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.

inputs
  • sized order
  • broker route
  • slippage / commission profile
outputs
  • confirmed fill(s)
  • position record (entry context attached)
  • live mark-to-market hook
position live
STAGE 09Live Position Management

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.

inputs
  • new frames
  • running mark-to-market
  • running Λ-Vol state
outputs
  • mark-to-market updates
  • regime-shift alerts
  • managed-exit triggers
exit triggered
STAGE 104-Leg Adaptive Exit

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.

inputs
  • entry anchors
  • live volatility envelope
  • regime-shift signal (if any)
outputs
  • partial fills at P1, P2, P3, P4
  • realized P&L per leg
  • exit-reason tag per leg
P1Scalp
40–50%
First target — secures cost basis.
P2Core
25–30%
Mid-target — reduces variance.
P3Extended
15–20%
Stretch target — captures continuation.
P4Runner
5–10%
Λ-Vol trailed — runs the regime.
trade closed
STAGE 11Telemetry & Manifest Write-Back

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.

inputs
  • closed trade record
  • live cohort vs cycle baseline
outputs
  • manifest entry
  • attribution row
  • drift signal (if any)
gates
  • manifest write succeeded
  • attribution decomposition sums to total P&L