# How Alpha Factory Works — Architecture, Fusion Methods, Runtime

**Canonical URL:** https://stratcraft.ai/alpha-factory/how-it-works

## Two-Layer Architecture

Alpha Factory is a two-layer system:

### Layer 1: Signal Factory
Produces many noisy reads. Each signal pack (Indicator, HMM, ML, Factor) emits one `SignalOut` — direction (LONG/SHORT/NEUT) + confidence (0–1).

### Layer 2: Combinator
Fuses the reads into one confident bet per symbol per tick. Five built-in methods, hot-swappable per asset class or market environment. Outputs one `FusedOut` and a ranked `Scoreboard`.

## Five Fusion Methods

All five take the same input (`list[SignalOut]`) and emit the same shape. Method is a runtime parameter.

1. **Equal Weight** — f = (Σ sᵢ) / n. Every signal gets one vote. Baseline.
2. **Confidence Weighted** — f = Σ sᵢ·cᵢ / Σ cᵢ. Loud voices win. Recommended default.
3. **Voting** — f = sign(Σ sign(sᵢ)). Majority wins. Robust to outliers.
4. **Max Confidence** — f = sₖ where k = argmax cᵢ. Trust the loudest. Aggressive.
5. **Min Confidence** — f = sₖ where k = argmin cᵢ. Trust the chorus. Conservative.

All five are pure functions. Switching method is a one-line config change.

## Dual Runtime

- **Python** — backtest: NumPy/pandas/pyarrow native, parameter sweeps, walk-forward, notebook-first
- **C++23** — live: sub-millisecond fusion, lockless ring buffers, deterministic latency

Same combinator, two runtimes. A signal validated in the lab ships to live without a port.

## Tick Lifecycle

1. Market feed → tick arrives
2. Signal Factory → all signal packs emit SignalOut
3. Combinator → fuses into one FusedOut per symbol
4. Scoreboard → ranks across symbols
5. Portfolio → acts on the Scoreboard

## Brand

- Product: StratCraft
- URL: https://stratcraft.ai
- This page: dark/light sections
