The Desk
Five opinions, one number, five ways to refuse
The compositor is where the whole system's intent becomes visible. It fuses five prediction sources into a single score, weighting each by how well that source has actually performed — and then it spends most of its code looking for reasons not to act.
services/signal_compositor.py
718 lines — the largest service
Runs every four hours, market hours only
Five sources contribute. A technical reading refreshed every four hours; a daily sentiment composite; a weekly language-model verdict; an alpha-factor score; and a quantitative score which, absent its optional dependency, is arithmetic on indicators. Each is asked for a value, and each returns a score normalised into the interval minus one to plus one, so that the fusion step is unit-free.
Normalisation differs by source in a way that matters. The two prediction-log sources — technical and language-model — are converted as a direction sign multiplied by the stated confidence, so a high-confidence downward call becomes a strongly negative number. The three score-based sources are mapped linearly from their zero-to-hundred range by subtracting fifty and dividing by fifty. A source reporting exactly fifty contributes exactly nothing.
That last property is a quiet hazard. Three of the five sources return a neutral fifty when they fail, and two of those failures are common: the quantitative scorer returns fifty when its package is absent, and the alpha scorer returns fifty when no factors have been promoted to active. Both are indistinguishable, at the fusion step, from a source that looked carefully and concluded nothing.
The weighting is the genuinely novel part. Each source has a base weight — the language-model debate carries the most at thirty per cent — and that base is multiplied by two performance terms. The first is the source's Elo rating divided by the mean Elo across all rated strategies, so a source that beats its peers head-to-head is scaled above one. The second is the calibration multiplier: if a source says seventy per cent and is right eighty per cent of the time, it is scaled up; if it is right sixty, scaled down.
Both terms are computed from reconciled outcomes, so the compositor's opinion of its own inputs is derived from evidence rather than assumption. This is the design's best idea.
Then come the refusals. A composite inside a narrow deadband is a hold. A confidence below the threshold is skipped. A daily trade count at its cap is skipped. A missing entry price is skipped. And a position check against the broker is skipped if it fails — the exception path returns a skip, not a proceed, which is the correct direction for a system that can spend money.
The compositor's opinion of its own inputs is derived from evidence rather than assumption. That is the design's best idea.
On Elo-weighted and calibration-weighted fusion