Evolution Based Relational Computation
Small programs, market relationships, and the road from trading simulations to directional signals
Abstract
I started EBRC by treating the stock market as an ecosystem of interacting players rather than a collection of isolated prices. I wanted small computational models to find useful relationships between them. The first approach evolved short programs against a trading simulator. That produced a working research and paper-trading system, but also misleading returns, execution mismatches, overfitting, and several architectures that did not work. I gradually separated the question of whether a relationship predicts direction from whether I could trade it profitably. The work moved toward bank-to-bank quote-state predictors, then toward individual market events. The clearest forward result was one live session on May 6, 2026: 171 correct directions among 242 resolved bank/XLF predictions, reported as 70.7%. Later historical work found much higher conditional next-trade-side consistency at millisecond horizons, on a different target. Neither result establishes a profitable trading strategy or a broad-market forecasting product. This is the road to those results, including what I had to retract and what remains unfinished.
1. Why
The question was not simply whether I could predict a stock from its own history. It was whether the relationships between participants carried information that isolated observations missed.
I later described the starting point as seeing the market “not as a blob of uncertainty, but rather an ecosystem with different players.” I was interested in how information related to the pieces around it, not just what each piece said on its own.
Banks became the main research group. My intuition was that they could be canaries for activity elsewhere in the market. That was a reason to investigate, not a result already established. Predicting one bank from other banking names and predicting what the wider market does next are separate claims. The work reached the first much more clearly than the second.
The name matters here: Evolution Based Relational Computation. Evolution was how the early programs were found. Relationships were what I wanted them to compute over. The later experiments changed the machinery without dropping that question.
2. Approach
Evolving the decision-maker
The early system was a population search over small bytecode programs, not a large neural network. A program could read numerical registers, combine them with arithmetic, comparisons and simple stateful operations, and write a directional signal. Mutations changed instructions and weights; selection kept candidates that improved simulated trading performance on the same evaluation window.
Inputs included each stock's recent movement and activity, pairwise relationships, and, in later versions, quote and macro context. A rolling tick queue made the input a recent slice of market activity rather than an isolated price. The signal could mean long, short, or do nothing. Some programs effectively disabled particular stocks. That was sometimes useful selection, not necessarily a broken output.
One documented nine-stock generation used fourteen instructions per stock and a 1,584-byte squad. Those dimensions changed between generations. The point was to keep the decision-maker small enough to decode and inspect, then put the complexity in the environment it was selected against.
That made the simulator part of the model. If it allowed cheap reversals, unrealistic fills or inconsistent position sizing, evolution could learn those mistakes. It was optimizing the world I gave it, not the world I intended.
From programs to conditional relationships
The later banking work used simpler predictors. I measured quote changes, encoded states, and counted what happened next. One representation quantized bid price, ask price, bid size and ask size into four levels each, giving 256 possible states. Other experiments combined several canaries into a joint-state lookup for a target.
For the bank model taken live, each target had a fixed chain of canaries, chosen through greedy discovery. The historical predictor walked dates in order, used previously accumulated state counts, and committed new observations after the day. Counts decayed with a sixty-day half-life, and a state needed at least twenty historical observations before it could produce a prediction.
For example, the PNC chain used XLF, BAC, USB, MS and WFC, with different lookback windows, to predict a nominal H=1.000-second target direction. The archived historical implementation compares midpoint values at t+L and t+H+2L; the exact invocation for the published summary has not been recovered. This was not the original evolutionary bytecode architecture. It was a later way of asking the same relational question with fewer moving parts.
There is an important distinction: past-only counting prevents future outcomes entering a prediction's state table. It does not remove bias if the chain itself was selected using the dates later used to evaluate it.
- Use previously accumulated state counts
- Predict the target direction
- Commit new observations after the day
Conceptual; past-only counts do not isolate chain selection from evaluation dates.
3. The road
March–early April 2026: establish the machinery
The surviving chronology places the early engine lineage in March. Period-aligned pair and rank features developed into a rolling-queue system. Matching the historical and live input shapes was an explicit reason for that change. There was also a pattern-event branch with a small vocabulary of market movements; it was explored but not deployed.
Early simulation totals became enormous. I do not treat them as evidence of achievable returns. The archive itself calls some of them fantasy numbers. They belong in the history as a warning about what the simulator could reward, not in the results as financial performance.
April 14–20: make the system survive contact with a broker
I built paper-broker integration, persistent runtime state, additional market context, replay and deployment tools. Saving only a program was not enough: rolling queues, running statistics and other state affected its behavior after a restart.
A heavily modified engine then failed to reproduce its baseline even with the added features disabled. The response was to preserve clean parents and make explicit experimental forks. Concurrent evolution also meant that a fixed random seed did not guarantee a fixed outcome: thread scheduling changed the search. A single attractive run could not settle an architecture comparison.
The simulator needed broker constraints and execution costs. Reversal restrictions, unavailable shorts, bid/ask crossing and latency all mattered. Then I found the opposite error: some fixed spread assumptions were much harsher than the quote data justified. Being pessimistic was not the same as being accurate. Forced liquidation also had to charge the same costs as ordinary exits.
Adaptation was another moving target. Continuous replacement could chase recent noise; freezing could leave a program stuck after a regime change. I tried conditional adaptation instead. Later experiments would again favor freezing over daily retraining. These were competing findings under different configurations, not one settled rule that adaptation always helped or always hurt.
April 21–24: scale, acceleration, and more ways to fool myself
I expanded the engine to the NASDAQ-100 universe and built parallel tick processing and GPU candidate-evaluation paths. More stocks did not automatically produce more useful relationships. Search became harder, and longer training could worsen forward behavior.
The implementation work exposed several false comparisons. A GPU sizing setting had silently fallen back to a smaller allocation. Parallel pools shared a starting parent, so they were not independent random starts. Repeated tests on one bullish date window were not independent evidence that an architecture generalized.
I also tried long-only variants and separate loss- and gain-response channels that changed conviction. Some branches were built but not run. Building a mechanism is not evidence that it helped.
The paper-trading loop ran, but deployment parity was incomplete. Position sizing could differ between engine and broker driver, and an attempted shutdown left positions open before manual cleanup. This was a prototype with operational faults, not a production trading system.
April 25–28: retract the return and test the alternatives
The bank simulation produced a headline +138.76% during an April 26 historical walk-forward experiment extending across forty-eight trading dates. That was not live trading. Later the same day, the records explicitly rejected it as largely an artifact of frictionless training. A model trained under that easier fill regime returned −1.06% across eight historical deployment days and seventy-three simulated trades when evaluated with realistic fills. Those are different runs, not a like-for-like recalculation of the full earlier window. The shorter test was enough to undermine the earlier interpretation, not to establish a definitive corrected return.
Different evaluation windows; not a like-for-like recalculation.
Earlier run
+138.76%
48 trading dates
Frictionless fills; interpretation rejected.
Separate run
−1.06%
8 deployment days; 73 trades
Realistic fills; simulated trades.
I tried making the firing decision part of the evolved formula, selecting stock programs independently, and changing mutation pressure toward the stocks doing worst. These were attempts to stop imposed thresholds and group fitness from hiding what individual programs were learning. The first formula-based firing attempt overtraded. Independent selection also introduced a tension: changing one stock's program could disrupt dependencies elsewhere in the squad.
Other attempts failed more directly. Dynamic conviction floors recruited weaker stocks and diluted the existing contribution. A day-end gate revealed that apparently useful performance depended on extreme tails rather than consistent modest gains. Time-of-day specialists fragmented the search budget and had weak phase-specific evaluation. A second, faster program intended to learn when to trust a slower directional program did not solve the problem. Flipping the directional output did not rescue it either.
There was a visual branch too. I rendered quote-stream dynamics as images and clustered them with a pretrained vision model, looking for recurring precursors. Apparent directional clusters weakened after subtracting market drift. The strongest remaining example depended on a single selloff day; removing that day collapsed it. The images were identifying the texture of an ongoing move, not a reliable advance warning.
- Early: select programs by simulated return
- Later: measure conditional direction
- Execution still needs spread, fills and sizing
Conceptual; a directional measurement does not establish executable profit.
May 2–3: ask about direction before profit
The turning point was separating signal measurement from execution. A return mixes direction, magnitude, spread, fills and sizing. A negative return does not tell me which component failed.
I moved toward small quote-feature models and online directional measurement. Within-day train/test splits looked better than cross-day tests; adding windows and features often made things worse. I explored a layered design: a directional predictor, consensus across configurations, a regime classifier, and a possible pre-event detector. The broader interpretations of those layers remained hypotheses, especially any claim about identifying informed actors before news.
Banking names showed an asymmetry in the chosen measurements: some acted as useful inputs for others, while some benefited more from compound prediction. I called them apexes and feeders. That described an observed predictive topology, not proof of causal information flow.
A larger compound regression became unstable through collinearity. A more elaborate perception design performed worse. Simpler combinations and direct lookup were more useful. A dated holdout comparison was recorded, but that did not make every later discovery on the same historical corpus independently held out.
May 4–6: atomic states, a currency detour, and a live test
The atomic quote-state work made the relationships easier to inspect. Expanding the historical bank corpus to 492 trading dates, May 1, 2024–May 1, 2026, gave the work a longer range of conditions. That is historical coverage, not two years of live operation.
Currencies were a useful detour because they exposed a confound. An apparent FX lead result collapsed after removing a shared US-dollar factor. The original claim was withdrawn. Subsequent FX work rebuilt from pairwise measurements, then tested frozen chains and past-only tables. It also included a shuffle control. Those FX controls cannot be silently reassigned to the banking result.
Mixing currency inputs into bank chains improved discovery-period scores but degraded the chronological adaptive evaluation on sparse targets. I kept the bank-only chains. Some session notes call historical adaptive evaluation “live.” I distinguish that from an actual real-time feed.
On May 6 I ran the frozen bank model against incoming live quotes. Porting the predictor exposed timestamp-unit mistakes, mixed trade and quote events, out-of-order arrivals and inconsistent clocks. These were corrected during the session. Historical replay was used to check agreement between the predictor implementations.
The available live feed was consolidated and sparser than the historical training feed. Many opportunities produced no usable movement or could not fire. That motivated outreach for denser data. It did not prevent the limited forward test reported below, and it does not establish that data access was the only remaining obstacle.
Selling direction as a feed rather than trading it myself became a possible route. It stayed a proposal, not a demonstrated business.
May 11: change the target again
Richer historical event data made a different question possible: instead of predicting the next midpoint change, predict the side of the next trade event.
The strongest conditional measurements were at millisecond horizons, often on the same ticker. I examined event sequences, trigger and target sizes, book imbalance, activity, and cancellation behavior. Conditioning on a trade against a counter-loaded book produced particularly high next-trade-side consistency in selected names.
Large-trade-pair tests challenged a simple small-clip slicing explanation. They did not establish who placed the orders or rule out every shared-order or shared-desk mechanism. High tape activity also degraded the measurements. Adding agreeing canaries did not simply multiply confidence. The joint state carried information that a vote could discard.
I expanded the targets to trade size, timing, event type, and order-addition and cancellation sides. They did not all inherit the directional result. Aggregating the microstructure into longer bars did not produce a convincing broad directional predictor.
There was another correction: a reported 85.33% same-direction continuation among 2,460 qualifying historical bar pairs, excluding unavailable, invalid and flat next bars in the 250-day study, was not an unconditional trigger success rate. The later note withdrew that interpretation. A separate trigger-based measurement found roughly 46% follow-through among 373 large-down triggers. The denominators and conditioning differed. I cannot keep the first number as a forecasting headline after discovering that distinction. record
4. Results and their scope
These are recorded experimental results, not a fresh reproduction of the archived event streams.
Recorded May 6, 2026. Selected chains; discovery overlaps evaluation dates. Each target has its own denominator; no pooled rate is implied. Inspect the published record →
98.65% · n = 2,894
99.40% · n = 2,661
Measured May 11, 2026. Conditional same-ticker event side within one millisecond, not live price direction or profit. Selection isolation from the second half is not established. All forty half-split rows →
Full results and qualifications
| Experiment | Recorded result | What it supports |
|---|---|---|
| Frozen bank/XLF model, May 6, 2026, one real-time session beyond the historical window record | 171/242 resolved predictions correct; reported 70.7%. Recorded 95% interval: 64.9–76.5%. The historical note reports 64.9–76.5%; its calculation method is unrecorded, and these endpoints were not reproduced from 171/242 using normal, Wilson or Clopper–Pearson intervals. For comparison only, an independent-binomial Wilson 95% interval is 64.6–76.0%. This comparison does not adjust for correlated predictions or establish sustained performance. | A limited forward directional result across bank/XLF targets. Predictions, not executed trades. The denominator excludes the much larger stream of unusable or no-move opportunities. |
| Historical PNC chain, recorded May 6, over the 492-date May 2024–May 2026 corpus record | 76.13% on 55,530 predictions with past-only state updates. | Strong historical conditional direction measurement for one target. Chain discovery overlapped evaluation dates, so this is not a fully selection-isolated historical holdout. |
| Same historical run, all eleven target chains record | 63.95% reported mean across chains. | PNC was not the system-wide accuracy. The reported mean is across chains, not a pooled event-weighted rate. |
| Selected PNC BID-side, same-ticker next-trade condition, measured May 11 on 250 historical trading dates, May 1, 2024–April 30, 2025 record | 98.65% on 2,894 events in the first 125-date half; 99.40% on 2,661 events in the second half. | Temporal consistency of a narrowly conditioned next-trade-side measurement at a one-millisecond horizon. Not live price-direction accuracy, not coverage of every event, and not established profit. |
The live interval is the one recorded in the session, not a newly validated estimate. Predictions from correlated banking names and nearby moments need not be independent. A single session cannot establish sustained reliability across regimes. I also do not have a complete underlying live-event audit attached to this account.
242 resolved predictions only
Excludes unusable/no-move opportunities.
The May 11 notes call the split “held-out validation.” The procedure they describe remeasures selected peak conditions on two historical halves. That supports consistency over time; it does not document that condition selection was isolated from the second half. It would be wrong to promote the table into a general claim of independently tested market-prediction accuracy.
My later recollection says out-of-sample and shuffle tests held. The recoverable records support the bank forward session and a separate FX shuffle result. They do not justify assigning a bank-specific shuffle statistic here.
The strongest result is therefore not one number. It is a set of scoped findings: useful bank-direction relationships in historical data, a small real-time forward receipt, and high conditional event-side consistency on a separate historical task.
5. Limitations and open questions
Selection remains part of the evaluation problem. Chronological updates, date splits, repeated discovery and untouched forward testing are different safeguards. They should not all be called out of sample without qualification.
Prediction is not execution. The work repeatedly found moves too small relative to spread for the tested crossing-spread approach. Later market-maker value calculations assumed favorable fills and a simplified baseline. They were scenarios, not measured customer savings or trading revenue.
Relationships are not identified causes. Common factors, venue effects, order splitting and coordinated execution can produce structure. The dollar-factor correction showed why a convincing relationship needs controls before receiving a stronger interpretation.
Targets changed. Bank midpoint direction, conditional next-trade side and longer-horizon ETF direction cannot share one accuracy headline. The later event-level result did not supersede the earlier forward receipt.
Breadth and deployment remain unfinished. The records do not establish sustained live performance, a validated broad-market extension, profitable real-money trading, or a sold production signal feed. They also contain unresolved implementation and execution issues. Some blanket conclusions in early architecture notes were revised by later experiments; I have kept the revisions rather than treating every confident note as final.
6. Where it stands
I had deliberately shelved EBRC by October 11, 2026. Part of that was practical: “Research necessitates funds, and funds don't come on their own.” I was one person, and I prioritized work intended to support the company.
There were research-specific reasons too: access to the desired dense live data, the move into high-frequency territory, and the work needed to identify other groups and map downstream relationships. When I later said I could not test it live, the distinction was the desired dense feed. A sparser-feed live test had already happened.
The next step would not be another search for a larger percentage on the same dates. I would freeze the targets, chain-selection procedure and conditions, then collect a longer forward record with explicit abstentions, timestamps and feed provenance. I would separately test whether the event-level conditions survive at an actionable latency, and whether banking relationships carry information into genuinely different groups.
If execution becomes the objective again, it needs its own evidence: realistic queue and fill behavior, inventory effects, and value beyond the intended user's existing predictor. If direction remains the objective, it needs a clean directional evaluation rather than a profit argument substituted for one.
What I have is a research system and a trail of measurements, corrections and unfinished branches. The relational idea reached concrete tests. The larger map is still unfinished.
Suggested citation: Yuval Halfon. Evolution Based Relational Computation: Small programs, market relationships, and the road from trading simulations to directional signals. Account prepared November 8, 2026. Draft, not yet published. https://yuvalhalfon.com/projects/evolution-based-relational-computation.html.
Questions or corrections: contact@yuvalhalfon.com.