Mithraeum · Agora

Stage five

Combining into a book

One strategy is a bet. Several strategies with different failure modes, sized deliberately, is a portfolio — and the difference between those two is mostly arithmetic that is easy to do optimistically.

The portfolio lab

Saved runs are blended into a combined book: each leg gets a weight, the book gets a rebalancing schedule, and the result is a single equity curve with its own statistics. Legs reference the runs that produced them, so a blend is a set of pointers rather than a copy — you can always get back to what each leg actually was.

The Mithraeum — Portfolio lab · a blend, modelled end to end
The portfolio lab's blended book for a demonstration blend of three synthetic legs over their common 1,060-bar window with no rebalancing: each leg's curve, the blended buy-and-hold dashed, and the blend in the accent colour, under the application's hypothetical-results warning.
A blend is a set of pointers — drawn whole. Three legs over three synthetic series, each referencing the saved run that produced it, blended into one book and drawn over the window all three share — 1,060 bars here, with no rebalancing — against the blended buy-and-hold, under the application's own warning. The blend's worst dip is a fraction of its worst leg's, and it finishes below the blended buy-and-hold; both are there to read. Demonstration blend on invented tapes.

Cross-sectional rotation

A different shape of strategy: rather than deciding whether to hold one thing, rank the members of a universe against each other through time and hold the leaders, rebalancing on a schedule.

AT EACH REBALANCE DATE Rank the universe by the chosen metric, using only data available on that date Take the top K the leaders, that day Compare to what is held the difference is the trade list keep sell buy Charge the turnover rotating is trading, and the model pays for it here Hold until the next date rotation sells members; only you stop the deployment repeat, next rebalance date
The loop, with its costs attached. Keeping a member is free — dashed, no charge. Selling and buying are not, and the charge is applied inside the model rather than remembered afterwards. The rank is computed on a prefix of history, so the loop can only ever see what was knowable on the day.
The ranking is the same code as the screen's. The rank a rotation uses comes from the same metric implementation the universe screen shows you, handed a prefix of history so it can only see what was knowable at that point. Mirroring the metric in a second implementation is how a backtest and a screen quietly stop agreeing — so there is one, and it is given less data rather than different code.

Ranking rules can be mined as well as written. The rotation miner sits on the Mine page beside the single-tape search and searches for rules of this shape across a universe — rank it through time, hold the leaders, charge the turnover — with every rank it tries computed from a prefix of history, so no rule it finds can have looked good by ranking with data from after the date it ranked.

Three layers, three verbs

Rotation, deployment and strategy each own a distinct set of actions, and the separation is deliberate:

LayerOwnsCannot
The screen / deployment Deploy and stop
Rotation Add and sell members Destroy a deployment
The strategy Entries and exits within a member Change what is in the universe

That last constraint matters in practice: a rotation model that could tear down a deployment would make it impossible to reason about why a position disappeared. Rotation sells; only you stop.

From a search's leftovers to a book

The other way a book gets made is out of what a search kept, and the ordering matters more than it looks. A mining run's leaderboard is sorted by the thing the run was optimising — which is precisely the ordering the search has been flattering all along. Taking the top few from it and blending them is combining a set of strategies chosen for having been luckiest at the one number you cannot trust.

So the ranking is redone before anything is combined: by how the survivors did on data the search never touched, then by their worst held-out window, and only then by anything else. A tier with too few members to be a ranking is not treated as one, and absence sorts last rather than middling. Members are weighted by inverse volatility, and any curve that does not sit on the same time axis as the rest is refused by name — two equity curves of equal length over different dates are not comparable, and silently averaging them produces a beautiful, meaningless line.

Ranking on the in-sample score is still available and takes a confirmation, because occasionally it is genuinely what you want to look at. It is a deliberate act rather than the default, which is the pattern everywhere in this application: the convenient thing is never the automatic thing.

Long and short

A book can hold both sides. The costs are charged on gross churn rather than net, and a short leg never silently finances a long one — borrowing is modelled rather than assumed free, because a long/short book that treats short proceeds as spendable cash reports leverage it does not have.

Nothing on this page is investment advice or a performance claim. The figures inside the frame are a demonstration blend's own arithmetic over app-generated synthetic series, behind the application's standing hypothetical-results warning — illustrations, not results. Trading involves risk of loss, and combining strategies does not remove it.

A personal project. Not advice. Nothing for sale.

This site describes a personal engineering project, written and run by one person in their own time and published under the name Mithraeum Agora. There is no company behind it, no team and no other contributor. It is not a product and not a business. Nothing here is for sale — there is no account to open, nothing to buy, no subscription, no waiting list, and no service is being offered or solicited. Sending a message through the note form creates no customer, client or contractual relationship of any kind. The note form on the contact page is the way to reach me, and it is the only one.

Nothing on this site is investment advice, financial advice, tax advice, or a recommendation, solicitation or offer to buy or sell any security or financial instrument. I am not a financial adviser, a broker, an investment manager or a regulated firm, and nothing here should be relied on as though I were. If you are making decisions about money, take advice from someone qualified and regulated to give it.

Figures do appear on this site, inside screenshots, and none of them is a performance claim. Every one is a demonstration instance's own arithmetic over price series the application generated itself — synthetic data, with no real market behind it — shown to illustrate what the tools display. They are hypothetical and simulated: no capital was at risk, no orders were placed, and a result computed over history with the benefit of hindsight carries limitations that live trading does not forgive. Hypothetical results are not indicative of future returns, and past performance — real or simulated — predicts nothing.

No brokerage, market-data vendor or other company is named anywhere on this site, and where a name appeared inside a screenshot it has been redacted out of the image. Nothing here states or implies that any company is associated with this project, endorses it, sponsors it, supplies it or has reviewed it. None is, and none has.

What this site collects. Nothing, unless you write to me. There is no analytics, no tracking, no advertising, and nothing at all is loaded from another domain. If you use the note form it takes the name, address and message you type, stores them privately where only I can read them, and keeps them for up to a year before they are deleted — sooner if you ask, and you do not have to give a reason. Your IP address is not kept. One thing is stored on your own device: the colour theme you pick, remembered by your browser so the site does not change appearance every time you arrive. It is written only when you choose a theme, and it identifies nothing and nobody. The preference itself never leaves your browser, but the screenshots follow it, so the pictures your browser fetches from this site are the ones drawn in that palette. The contact page answers all of this in more detail.

Terms of use. This site is provided as is and as available, with no warranty of any kind, express or implied. It describes software under active development: anything here may be incomplete, out of date or simply wrong, and it may change or disappear without notice. Nothing on it is a contract, a term of service for any product, or a promise that anything described will be built, released or kept running. To the fullest extent the law allows, I accept no liability for any loss or damage arising from use of this site or from reliance on anything it says. Nothing here excludes or limits any liability that cannot lawfully be excluded or limited.

Trading involves risk of loss.