Multi-agent system for equity analysis

BO.I.A.

Many readings of the same stock, chosen because they contradict each other. Some use no artificial intelligence at all, and they are the yardstick the others are judged against. A deterministic arbiter turns them into one judgement, and every forecast carries the date on which it can be proved wrong.
The ambition is not another tool promising returns. It is an analysis engine that accepts up front the standard by which it will be judged, and makes that standard verifiable by anyone.
Domain: US equities, S&P 500 Horizon: swing, days to weeks Criterion: predictive value of the signal, measured against a yardstick without AI Operation: nightly, on a dedicated server
↓ every section has a technical layer you can open
THE THESIS

A single analyst, artificial or human, has a single way of being wrong

Almost every automated analysis system applies one criterion to the whole market. It works as long as the market resembles that criterion, and stops working when the regime changes — without anyone noticing, because there is no second point of view to contradict the first.

BO.I.A. starts from the opposite assumption. Structurally different readings — one following trends, one hunting excesses due for correction, one reading volume, one watching what company insiders do with their own money, one reasoning about the macroeconomy, one whose only job is to dismantle everyone else's case — are put into disagreement deliberately. Alongside them runs a small set of purely mechanical readings that query no model at all: not a fallback, but the yardstick. The value is not in any single opinion: it is in how much they agree, and in what happens when they do not.

≠

Disagreement is data

Every judgement carries a measure of how far the agents diverge. A unanimous consensus and one scraped together by a narrow majority are not worth the same, and the system does not present them as if they were.

⊘

One agent exists to say no

The contrarian receives the stocks with the strongest consensus and must attack them. It does not vote: it produces a warning that stays attached to the final judgement. It is the structural brake against collective enthusiasm.

=

Every forecast is then checked

A forecast declares an action, a horizon and a confidence. At expiry the system checks whether it beat the index over the same window. The verdict is recomputed from raw data, never stored: nobody can retouch it.

Deep dive — what «competitive multi-agent» actually means open / close

Each agent is a language model driven by a versioned prompt and by a data selection different from the others. It does not produce free text: it produces a structured object validated against a schema. For every stock it returns an action (BUY / SELL / HOLD), a confidence, a reasoned thesis, a target price, a stop level and a time horizon declared in days.

That declared horizon is not a detail: it is the falsifiability condition of the forecast. An agent saying «it will go up» without saying by when cannot be proved wrong. Here every forecast carries its own expiry date, and at expiry it is judged.

Purely deterministic readings — whether one moving average sits above another, whether volume exceeds a threshold — are not delegated to the model. They are computed in code and handed to the agent already resolved. What is left to the model is judgement, not arithmetic: that is the part where a language model adds value, and the only part where it is used.

no AI
the readings used as yardstick
1
deterministic arbiter
JSON
schema-validated output
0
AI calls in the arbiter
THE GOALS

The criterion is declared before the results, and includes the condition that shuts the project down

A goal that can be rewritten after the fact is not a goal. These are fixed in the project specification, together with the explicit condition that triggers its shutdown.

The signal must be worth more than a mechanical rule
Every reading produced by a model is compared with purely deterministic readings, computed in code on the same data over the same window. If the model's judgement does no better than the mechanical rule, the model is not adding information: it is adding cost.
Selection must be worth more than a draw
Alongside the portfolios driven by the system, one is composed at random. It is the question no comparison between strategies can settle on its own: whether choosing is worth more than drawing.
The squad must be worth more than one
If aggregating many readings does no better than the best one taken alone, the cost of the multi-agent architecture is not justified. The system answers this question by itself.
The failure condition
The squad must show a correlation between score and excess return of at least 0.04, with the 95% interval entirely above zero, measured on the replayed sessions and not on the portfolio curve. The threshold is set before the data are read; if it is not met, the project is formally archived.
Deep dive — why the primary metric is not profit open / close

Portfolio return is a noisy measure of an agent's quality, because it also depends on how much capital goes into each position, on execution timing, on sector constraints and on cash left idle. An excellent agent inside a bad sizing rule produces a mediocre portfolio, and the reverse is equally true.

That is why the judgement on agents is anchored to the signal, not to profit and loss: rank correlation between score and excess return over the index at the declared horizon, with a block-bootstrap confidence interval; the hit rate remains a descriptive figure. The portfolio remains as a downstream reality check, but it is not the yardstick for deciding whether an agent is worth keeping.

risk (volatility) → return ↑ target line «risk-free» return BO.I.A. target above the line = more return per unit of risk index (SPY) typical active fund
Indicative positions, not results. The further up and to the left a point sits, the better the return per unit of risk. The reference is typical active management: the project's criterion is not this curve but the correlation between score and outcome.
HOW IT WORKS

Four steps, from raw data to judgement

The chain is deliberately asymmetric: almost all the work is deterministic and costs nothing, and artificial intelligence enters only at the point where judgement is genuinely required.

1
Collection

Data is acquired

Closing prices and volumes, corporate events, derived technical indicators, macroeconomic series, transactions disclosed by executives to the US regulator. All from public sources, with continuity checks that flag gaps and discontinuities instead of ignoring them.

2
Selection

The universe is narrowed

A mechanical filter, with no AI call whatsoever, cuts the index down to a few dozen candidates: the ones actually moving. It costs nothing and removes most of the downstream spend.

3
Analysis

The readings speak

Each receives a data window built for its own specialisation and produces a structured judgement per stock. The contrarian goes last, once the others have spoken, and attacks the names with the highest consensus.

4
Synthesis

The arbiter produces one judgement

Deterministic aggregation, no AI: same input, same output, always. Out comes a consensus score, a disagreement measure, medians for target and horizon, and the contrarian's warning attached where applicable.

Deep dive — the layered architecture open / close

The four steps map onto four stacked layers. Information rises from the bottom; each layer is a separate package with the same internal structure — pure computation (no database, no network), persistence without commit, orchestration — so that the part which decides is always testable without touching real data.

L4 · ARBITER Deterministic, zero AI · consensus, disagreement, medians, contrarian warning L3 · THE READINGS Price several readings Insider one family Macro one family Contrarian does not vote L2 · MECHANICAL SELECTION Narrows the index to a few dozen candidates · no AI call, zero cost L1 · DATA LAYER Prices, corporate events, derived indicators, macro, insider filings — public sources
The highlighted layer holds the readings entrusted to a model, alongside the purely mechanical ones that serve as yardstick. Above and below it is deterministic code, verifiable line by line and reproducible at will.

The night runs on its own, and every step can stop it

The whole night runs on its own on a dedicated server: data acquisition, continuity checks, mechanical selection, the readings, the arbiter, the controls and the portfolio chain through to rebalancing. Every step has a gate that can stop the chain before it writes, the outcome of each night is recorded, and external monitoring raises an alert if a night fails to start.

THE SQUAD

Readings of the same stock, chosen because they contradict each other

These are not variants of one line of reasoning. Each looks at a family of data the others ignore, and under different market conditions they reach opposite conclusions. That is precisely the intended effect.

Price and volume
The three technicians
They read the movement, not the company. Two of them disagree by construction: one buys strength, the other treats it as an excess awaiting correction.
  • One chasing the trend in place
  • One betting on reversion to the mean
  • One checking whether volume confirms the move
Behaviour
The inside observer
Watches what the people who know the company from within do with their own money. Those transactions are filed with the US regulator and are public.
  • Purchases and sales disclosed by executives
  • Concentration and timing of the transactions
Context
The macroeconomist
Ignores the individual stock and looks at the environment: rates, inflation, activity indicators, sector positioning.
  • Official macroeconomic series
  • Regime effects on the relevant sector
Control
The contrarian
Enters last and sees what the others have said. Its job is not to be right: it is to make explicit the weak point of a thesis that is becoming popular.
  • Receives the highest-consensus names
  • Produces a warning, not a vote

The contrarian is the least intuitive architectural choice in the system, and the most important. Any engine that aggregates opinions tends to reward conformity: the more agents agree, the higher the score climbs. The contrarian exists to break that mechanism from the inside, and it is measured like everyone else — with the understanding that a low hit rate is its expected behaviour, not a defect.

Deep dive — the families of reading, and how they are compared open / close

The readings do not all run on the same model. Some exist in several variants, identical in everything but the text that guides them: that is how a single variable is isolated, to find out whether a different wording is worth its price. The same setup allows models to be compared with everything else held equal, and the comparison is only possible because everything else stays identical byte for byte.

The families of reading

Trend Hunter
momentum · breakouts · moving averages · trend strength
Reversion Sniper
oversold and overbought · pullback to the mean · divergences
Volume Whisperer
volume against its own average · accumulation and distribution
Insider Tracker
executive transactions filed with the SEC on Form 4
Macro Strategist
rates and official macro series · sector impact
Devil's Advocate
mandatory critique of high-consensus names · warning, not a vote
Mechanical readings
moving-average momentum · mean reversion · volume against its own average — no model queried
Long-horizon readings
twelve-month momentum excluding the last month · distance from the 52-week high · volatility regime · sector strength: measured like the others, outside the vote

The mechanical readings are neither a fallback nor a leftover: they are arithmetic, and they exist to answer the most uncomfortable question this project can be asked — whether the model adds anything to a three-line rule.

Why this matters when assessing the project. Squad composition is versioned. When a new agent joins, the historical performance series are not contaminated: every evaluation window stays bound to the squad active in that period. Without this, any apparent improvement would be indistinguishable from a change of line-up.

THE ARBITER

How conflicting opinions become one judgement, without an AI deciding

The point where most multi-agent systems insert yet another language model is, in BO.I.A., deterministic code. The reason is verifiability: an aggregation performed by a language model is not reproducible, not inspectable and not recomputable months later. This one is.

Deep dive — aggregation, disagreement, and the weighting that is not there open / close

The arbiter receives the signals available for a stock and produces a consensus score between −1 and +1: the average of direction times confidence across the sources actually present. The final label follows the pure sign of that score. Alongside it, a disagreement score computed as the normalised entropy of the directions: high means the agents are deeply split, and that number travels with the judgement instead of being buried.

Five votes plus one warning BUY HOLD SELL Trend Hunter Reversion Sniper Volume Whisperer Insider Tracker Macro Strategist Devil's Advocate warning, outside the count aggregate JUDGEMENT — BUY consensus score +0.42 disagreement (entropy) 0.58 — medium sources present 5 of 5 horizon (median) 14 days contrarian warning present
Structure of a judgement. The values shown are illustrative; the shape and the fields are the ones the system actually produces.

Why every agent carries equal weight

All agents weigh the same, with weights fixed at 1.0, deliberately. Estimating reputation from a few dozen outcomes would mean amplifying noise and calling it learning: a handful of lucky calls would be enough to let one agent dominate.

The rule. An adaptive mechanism enters the calculation only when the sample can bear it; until then it stays switched off and is declared switched off. The cost of this choice is a less spectacular page; the benefit is that no number published here is the product of fitting on a sample that could not support it.

THE YARDSTICK

A forecast that made money may have lost

This is the idea the whole evaluation rests on, and the reason this project's yardstick is harsher than the ones found elsewhere. The question is not «did it make money». It is: did it do better than sitting still in the index, over exactly the same window?

BUY forecast, 14-day horizon — worked example +3.0% the stock +5.0% the index, same window −2.0% recorded outcome excess return = forecast WRONG
Absolute gain never enters the evaluation. Only the gap against the benchmark across the same two dates counts: rising less than the index means subtracting value, even when the account is in the black.
Deep dive — how the measure is built, and what it refuses to measure open / close

Every forecast has an entry date (the close of the day the analysis refers to) and an expiry (the horizon in calendar days the agent declared itself). At evaluation the system takes the last available close within the expiry, computes the return of the stock and of the benchmark across the same two dates, and the difference is the outcome. A BUY is correct if the excess is positive, a SELL if it is negative.

Four states, not a yes or no

A forecast can be mature (the horizon has passed and prices exist), in progress, without horizon (the agent never declared one: it leaves every statistic), or not evaluable with an explicit reason. The distinction is not pedantry: collapsing these states into a boolean turns a missing datum into a zero, and a zero into a tie that never happened. HOLD positions stay outside the hit-rate denominator, because they express no direction to verify.

The properties that make the number defensible

Outcomes are never stored anywhere: they are recomputed from raw prices on every request. This is a structural choice, not a convenience — a stored result can be corrected, updated or forgotten without anyone noticing. The guarantee is verifiable in the code: the module computing outcomes imports no module capable of writing. When the denominator is empty the hit rate is null, not zero per cent; when the sample falls below roughly thirty cases, the system prints its own statistical insufficiency warning.

Independent verification. Before any number was published, one outcome was recomputed by hand — direct database query and decimal arithmetic performed separately from the code — and compared field by field against the system output: prices, dates, returns, excess, verdict. Exact zero discrepancy on every field.

THE PROOF

What counts as proof, and why one comparison is not enough

The system is not judged by a single comparison. Two different things are measured on two distinct planes: whether there is information, and whether the engine survives reality.

Four simulated portfolios start from the same notional capital and run in parallel. One buys the index and holds it, and is the wall everything is measured against. One follows a single reading. One follows the arbiter with all active readings. The last one composes at random: not a provocation, but the only way to answer whether choosing is worth more than drawing — and without it, the comparison between the other three stays inside its own premises.

Above the portfolios sits the real yardstick, which is the signal. Every reading entrusted to a model is compared with the mechanical readings on the same data over the same window. The portfolio says whether the engine holds up; the signal says whether there is information. The two questions do not substitute for each other, and this page does not promise to conflate them.

None of these measurements counts until the sample holds. The system states by itself when a number falls below the significance threshold, and a measurement declared insufficient is not used to rank readings, to weight them in the arbiter or to remove one.

Deep dive — how portfolio writes are verified open / close

Every rebalancing is validated with four arithmetic recomputations independent of the code that produced it — proceeds from closures, full sizing of the openings, immutability of the fields that were not meant to change, manual recomposition of cash — plus a check that cash and positions add back up exactly to the portfolio value. An exit code of zero is not treated as proof.

Why portfolio construction is watched separately. The filter that admits judgements, the maximum number of holdings, the sector cap and the per-position size are the deterministic part: they can be changed, remeasured and compared. A gap between the quality of the signal and the result of the portfolio is not a contradiction to hide, it is an indication of which of the two planes to act on.

THE BACKWARD TEST

A backward test is valid only where the model does not remember, and that line is measured

It is the first question anyone assessing an analysis system asks. A backward test run without precautions would be a false measurement, and false in a predictable direction — upward. The precaution here is not to give it up: it is to measure first where the model's memory ends.

Two flaws, and how they are handled

«A model that has read the history of the market cannot be questioned about the past without cheating.»

◱

Contamination. Language models are trained on text that includes how those years turned out. Asking an agent what it would have done in 2019 means asking someone who already knows the answer. No prompt engineering removes the problem.

◲

Survivorship. A test built on the index's current members would ignore the companies that left it because they failed, were delisted or acquired. Index membership is therefore dated: in each replayed session selection is made among the stocks that belonged to the index on that date, and outcomes exclude forecasts on non-members. The remainder, stocks that left before the price archive begins, is declared.

The model can be asked, with no data given to it, what happened to a stock on a given date. Where it answers too well, it remembers: that period is contaminated and is not testing ground. Where it does not remember, the past becomes usable again, and past sessions can be replayed through exactly the same chain as the night, with every view of the data filtered to the simulated date. Replayed sessions stay marked as a separate population and never touch the portfolios.

Replay is the system's proving ground. Past sessions are replayed through the same chain as the night, with every view of the data filtered to the simulated date: hundreds of sessions in a few hours rather than months. The window starts where the probe measured that the model no longer remembers.

Deep dive — where a backward test remains legitimate open / close

The exclusion applies to the agents, not to the whole engine. The deterministic components — selection criteria, position sizing, stop thresholds — are ordinary code and can be tested backwards without contamination, because they contain no model that has read history. On those, retrospective testing is useful for comparing parameterisations and for telling statistical variability apart from a structural defect.

The line is sharp and worth stating plainly: test backwards everything that has no memory of the future, and nothing else. The difference from a project that merely declares it is that here the line is measured before it is used. Any system presenting brilliant retrospective curves on decisions taken by a language model is, knowingly or not, measuring the model's memory rather than its judgement.

WHAT IT COSTS

A full analysis of the index costs about as much as a coffee

The economics of the engine are the reason the architecture can afford many readings instead of one — and the reason it can add more without changing order of magnitude.

The cost structure follows from the architecture, not from a measurement. Mechanical selection comes before the readings and cuts the index down to a few dozen candidates without querying any model: that is where the bulk of the spend is removed. The mechanical readings cost nothing, and the arbiter makes no AI call. What remains grows with the number of stocks selected, not with the size of the index.

The distribution of final judgements each night is itself a watched datum: a skew toward buying is a known flaw of the category, and it is measured over time rather than ignored.

Deep dive — what runs, where, and with what guarantees open / close

The system runs on a dedicated server, with an isolated application database and an unprivileged role. The nightly deterministic chain is scheduled and completes in under an hour; an external monitoring service receives a heartbeat on every run and raises an alarm if a night is missed.

Backups are daily, encrypted and kept off the server, with thirty-day retention. The relevant difference is not that they exist: it is that the full restore chain — dump, archive, extract, load into an empty database — has been carried out end to end and verified to an identical cryptographic fingerprint, with tables and indexes counted. A backup that has never been restored is a hypothesis, not a guarantee.

The read interface is not exposed on the public internet. Data sources are public and free: prices and volumes, official macroeconomic series, corporate filings with the US regulator. There are no proprietary data subscriptions in the cost structure, and that is a scalability property rather than a compromise.

The dominant cost is not AI. At these volumes, model spend is negligible against engineering time. That is why the most promising lever is not reducing calls but increasing the quality of judgement per call — and why comparing different models with everything else held constant is an experiment the engine can afford.

THE BRAKES

The uncomfortable truths are written into the specification, not the footnotes

A project setting out to beat the market must state up front how unlikely that is, and the threshold at which it accepts being archived.

Active management versus the index, long horizon — order of magnitude around 90% do WORSE than the index ~10% Beating the market consistently is the exception. BO.I.A. starts from that and does not hide it.
Indicative proportion, consistent with the literature on active management and benchmarks; the exact percentage varies by period, category and methodology. The message holds: the bar is extremely high.
Deep dive — the gap between simulated and real open / close

Commissions, slippage (the gap between the observed price and the one obtained) and tax erode margins systematically, not randomly. A strategy earning three per cent gross on frequent trades can close at a net loss.

That is why every trade in the simulated portfolios bears a cost of ten basis points on entry and ten on exit, and the signal's break-even threshold is computed net of estimated costs. A theoretical gain that disappears after commissions and tax is not a gain: it is a measurement error.

On verification discipline. The project keeps an explicit register of its own open defects, numbered and dated, including the uncomfortable ones: metrics that depend on data freshness, components never exercised at runtime, checks that passed without their reason being understood. A recorded defect is one someone can ask to have closed; an unrecorded one is not.

THE RECORD

Analyses are read together with their outcomes

Every judgement issued is kept with its own expiry, and its outcome is recomputed from raw prices on every reading. The record is public: anyone can consult the analyses together with the verdict that followed them.

Wrong forecasts belong to the record as much as right ones, and the mechanism that measures them is built so that no one can tame it. A page showing only the successes would be more impressive and less credible.

Analyses published with their outcome
Every judgement can be consulted together with the verdict at its expiry, recomputed from raw prices. The error rate is part of the information, not something to bury at the bottom.
Agent track record over time
How each reading behaves across different market regimes, with squad composition versioned so that comparisons remain legitimate.

An honest experiment, not a promise.

BO.I.A. does not sell a forecast. It builds an engine that produces falsifiable forecasts, declares in advance the standard for judging them, and publishes the result even when it is mediocre.

The question is not whether the method works. It is whether a stretch of honest measurement says something that the same stretch spent on retrospective curves never would.