How the formulas in this package compose into a working ORB trading pipeline. This document explains wiring, not implementation — for formula details see the searchable index at formula.cfored.com.
DESIGN-INTENT ONLY. This stage map names integration targets; the files below (london_premarket.py, qc_analyze.py, alpha_agent.py, portfolio_optimizer.py, risk_manager.py, pipeline_runner.py, firebase_auth_state.py) do NOT exist in DevCEDTeam/Dashboard- production, and cbmas-orb-formulas is imported by nothing there. The real pipeline is the flat premarket/*.py + python/*.py layout (e.g. s4_claude_agent.py, not alpha_agent.py). UNWIRED.
Stage 1 market_fetch.py → raw OHLCV per symbol (external) Stage 2 london_premarket.py → sqrt_impact · OFI · VWAP · basis · FVG Stage 3 qc_analyze.py → vol_acf · Markov · Wonham · Hurst · ADF Stage 4 alpha_agent.py → FAN · OU · zscore · EMA/TSMOM · HJB Stage 5 portfolio_optimizer.py → cvar_lp_solve_robust (Student's t) Stage 6 risk_manager.py → kelly · ev_gate · gamma_scalp · parity Stage 7 rithmic_execute.py → bracket orders via AMP/Rithmic (external) Stage 8 pipeline_runner.py → orchestration Stage 9 firebase_auth_state.py → sharpe · sortino · capm · VaR (NCC)
Raw market data
↓
microstructure ─┐
├─→ statistics.beta_update_bernoulli (π update)
mean_reversion ─┤ ↓
├─→ risk_sizing.ev_gate_check (Gate 5)
trend_following ┤ ↓
└─→ risk_sizing.kelly_uncertain (sizing)
↓
risk_sizing.cvar_lp_solve_robust (portfolio)
↓
foundations.parametric_var_normal (report)
↓
foundations.sharpe_ratio / capm_regression (NCC)
| Gate | Formula | Check |
|---|---|---|
| 1 | (time-based) | Wall clock in 07:00–08:30 PDT window |
| 2 | hill_estimator → calibrate_nu_from_hill | PBO ≥ 0.5 → 50% haircut |
| 3 | (composite scorer) | Confluence adjusted ≥ 6 |
| 4 | quality_estimator | QE minimum ≥ 0.50 |
| 5 | ev_gate_check | EV = π·R:R − (1−π) ≥ 0.25R |
| 6 | (age-based) | Position age 60/90 min cap |
Wonham + HJB is an earlier-firing SAR trigger that complements — does not replace — the incumbent Parabolic SAR. Both run in parallel; Wonham fires when P(bull) drops through π** even while price is still near the high, whereas Parabolic SAR fires only after price starts to retrace.
┌── Parabolic SAR flip → EXIT
Live tape ─→ qc_analyze ┤
└── wonham_step → π_t → sar_signal → EXIT
(fires earlier)
| Factor | Package + function |
|---|---|
| F01 market state | qualitative |
| F02 CVD level | microstructure.order_flow_imbalance |
| F03 ORB breakout | mean_reversion.zscore |
| F04 AR(1) φ | trend_following.ts_momentum_regression |
| F05 Hurst H | trend_following.hurst_exponent |
| F06 playbook momentum | qualitative |
| F07 macro regime | qualitative |
| F08 TimesFM | external forecast |
| F09 pre-session action | microstructure.price_impact |
| F10 overnight gap | qualitative |
| F11 Claude confidence | external agent |
| F12 CVD slope | microstructure.order_flow_imbalance (Δ) |
| F13 drawdown guardrail | risk_sizing.cvar_lp_solve_robust |
| F14 Wyckoff AMD phase | trend_following.fit_transition_matrix |
| F15 iFVG CE precision | microstructure.detect_bull_fvg + consequent_encroachment |
16:00 PDT angelic_audit.py → 7-lens forensic review ace_reflector.py → InsightBundle ace_curator.py → delta_context_items.json (updates playbook_current.json overnight) Beta-Bernoulli π update: prior = playbook.pi_beta_params obs = today.wins, today.trades posterior = beta_update_bernoulli(*prior, obs.wins, obs.trades) playbook.pi_beta_params = posterior (auditable, single-line)
| Extension | Where to add | Notes |
|---|---|---|
| New confluence factor | microstructure/ or trend_following/ | Register with the composite scorer |
| Alternative scenario generator | risk_sizing/robust_cvar.py | Follow the generate_students_t_scenarios signature |
| Additional Greek | foundations/ | Analytical form preferred over numerical |
| New session regime | trend_following/markov.py | 3-state chain in production; can extend to 4-state |
| Chandelier stop | risk_sizing/ (new module) | Currently in commodity_orb.py — should be scaffolded |
| Parabolic SAR | trend_following/ (new module) | Currently referenced but not implemented |