4 min read

Regima

portfolio-analytics

A user-owned portfolio construction and backtesting platform for comparing explicit investment strategies with deeper portfolio analytics.

Summary

Regima is a working MVP for constructing portfolios, applying investment strategies, and reviewing their historical behaviour.

Many backtesting tools provide performance charts without making the underlying strategy sufficiently explicit. Regima starts from the opposite direction: the user selects a defined portfolio construction approach and receives analytics that help explain how the portfolio behaved.

Status

Working MVP

The core portfolio optimisation and backtesting functionality is implemented. Additional work remains around statistical analysis, product breadth, and the surrounding user experience.

The problem

Backtesting tools often make it easy to produce a performance chart, but harder to understand what generated the result. A portfolio may be presented with historical returns and risk measures without clearly communicating the allocation framework, the assumptions behind it, or how it should be compared with an alternative.

This makes it difficult to distinguish between a strategy-driven portfolio and a collection of analytics assembled after the fact.

Regima is designed to make the portfolio construction method explicit and connect it to the resulting performance, risk, and attribution analysis.

The original concept also considered using fully point-in-time constituent data to address survivorship bias. Reliable datasets for that purpose are paid, so this was not treated as a solved problem in the current MVP and is not presented as a feature of the product.

What it does

Users define a portfolio, select an optimisation strategy, and evaluate its historical behaviour.

The current system includes:

  • mean-variance optimisation (MVO);
  • equal-weight (1/N) allocation;
  • risk-parity allocation based on risk contribution;
  • historical price and fundamental data;
  • periodic or threshold-based rebalancing;
  • configurable costs for more realistic performance estimates;
  • performance, risk, and factor-attribution analytics.

The objective is not only to display a return figure, but to provide context for how that figure was produced.

From strategy to analysis

Make the assumptions behind a backtest visible

  1. Define the experiment

    Select the portfolio, historical period and available market data.

  2. Choose the allocation

    Use mean–variance, equal-weight or risk-parity portfolio construction.

  3. Set the operating rules

    Specify periodic or threshold-based rebalancing and configurable costs.

  4. Inspect the result

    Read performance alongside risk, holdings and factor-attribution analysis.

A conceptual overview of the implemented workflow. Backtest results describe the selected historical experiment and depend on its data and assumptions.

Methodological choices

The main design decisions are intended to keep the relationship between strategy and outcome visible:

  • portfolio construction is selected explicitly rather than hidden behind a single default approach;
  • rebalancing rules and triggers are defined as part of the backtest configuration;
  • trading and other configurable costs can be included in performance estimates;
  • performance is presented alongside risk and attribution measures;
  • different allocation approaches can be compared using the same analytical workflow.

These choices favour transparency and analytical usefulness over a single headline return number.

System

LayerTechnology
FrontendSvelteKit
BackendFastAPI
DatabasePostgreSQL
AnalyticsSciPy, scikit-learn
Market datayfinance
PackagingDocker

The frontend provides the portfolio and analysis interface, while the backend owns the data processing and analytical workflow.

Screenshots

Read the return together with the risk

Regima run overview showing the Tech Basket portfolio, historical period, return and risk statistics, and a net asset value chart.View full-size screenshot
Run context · top
The portfolio, asset list and historical period identify the experiment behind the chart.
Risk beside return · summary row
Sharpe ratio and maximum drawdown appear alongside return measures, keeping risk in view.
Product screenshot of an example historical run. The figures describe the displayed run, rather than a general claim about strategy performance.

Inspect what the portfolio actually holds

Regima holdings panel with horizontal bars showing asset weights for a dated portfolio snapshot.View full-size screenshot
Snapshot date · top right
The date establishes which allocation is being inspected.
Position weights · bars
The relative weights make concentration visible beneath the aggregate performance result.
A dated holdings snapshot. The bars describe allocation at that point in time, rather than portfolio weights throughout the backtest.

Explain why a rebalance happened

Regima rebalances table with dates, initial-allocation and periodic triggers, affected tickers and transaction costs.View full-size screenshot
Trigger · second column
Initial allocation and periodic rebalancing are recorded as different event types.
Costs and details · right
Each row presents its cost and an entry point to the underlying allocation changes.
A view of rebalance events. The trigger, affected assets and transaction-cost field are visible for each event.

Follow an allocation change down to the position

Regima allocation changes table with ticker, before and after weights, and the change for each affected position.View full-size screenshot
Before and after · middle columns
Position-level weights expose the change hidden behind an aggregate rebalance event.
Changed positions · rows
The view lists positions with a non-zero change from the previous snapshot.
An allocation-change detail view. Percentage differences between weights are interpreted as percentage-point changes. Each screenshot illustrates its own captured state.

Limitations and next steps

The current MVP is focused on the core optimisation and backtesting workflow. It can account for configurable costs when estimating performance, but it does not yet model returns from a tax perspective.

Future work includes:

  1. minimum-risk optimisation;
  2. a machine-learning optimisation approach, with the specific method still to be determined;
  3. user-interface improvements;
  4. probabilistic Sharpe ratio analysis to assess whether a portfolio’s performance is meaningfully better than a selected fund or benchmark.

These items are planned development work and should not be interpreted as currently implemented functionality.

Why I built it

I wanted a portfolio tool that combined portfolio construction, optimisation, and risk analysis without requiring the same analytical pipeline to be rebuilt for every experiment.

Regima is also a way to make investment methodology visible in the product itself: the allocation approach, portfolio rules, risk measures, and attribution should be inspectable rather than treated as implementation details.

Open Regima