Skip to content
All case studiesData

Tangente — quantitative portfolio analysis

A portfolio-analysis tool for stocks and ETFs that grounds every recommendation in maths — Markowitz optimisation, risk ratios, technical indicators — and always shows the figures behind it.

PythonFastAPISQLAlchemyPostgreSQLReactPyPortfolioOptpandas-ta
Cache-first
DB is the source of truth for prices
Pure fns
Every metric tested against known values
Decimal
Money is never a float

The challenge

Portfolio decisions were being made on gut feel. The goal was a tool that turns a real set of positions into defensible, numbers-first analysis — concentration, risk, performance, an efficient frontier — without turning into a black box that just says “buy this”.

Approach

  • Quant engine (quant/) — a set of pure, individually testable functions: Sharpe / Sortino / volatility / VaR, beta and drawdown, HHI concentration, XIRR / TWR performance, RSI / MACD / Bollinger / SMA, and an efficient frontier with its tangency point (PyPortfolioOpt). Each metric is checked against known reference values.
  • Decision scenarios — given a budget, the engine proposes an allocation that reduces concentration (“diversify”) or reinforces existing holdings, with the expected effect spelled out.
  • Data discipline — the database is the source of truth for prices; external providers (Finnhub, Yahoo/TSX) only fill the cache on a schedule, never from a user request, to stay inside API quotas. Broker exports (Disnat CSV for positions, XLSX for transaction history) import directly, with transactions de-duplicated across imports.
  • Correctness — monetary amounts are NUMERIC in the database and Decimal in Python, never floating point.
  • React dashboard — every recommendation is shown next to the metrics that produced it.

Result

The portfolio can be analysed end to end — composition, risk, technical signals, optimisation — from a single dashboard, with each figure traceable to its calculation and each suggestion explained rather than asserted.

Want an outcome like this?

Decision support, not tips: the app returns quantified scenarios (reinforce / diversify) with the metrics that justify them, never orders.

Book a call
Next case study →

Custom AI Agent for Knowledge & Support