LUCA SAVIO
Engineering · Case study

Tradeflow

In development

A trading-strategy SaaS: design a strategy on a visual diagram, run a historical backtest against it, and review standard performance analytics — no code required to use it, real engineering required to build it.

What it does

Users compose a strategy from blocks on a node-based canvas — data sources, technical indicators, entry/exit conditions, risk rules — and run it against historical OHLCV data. The result is a standard analytics view: equity curve, key risk metrics, and a monthly-return heatmap, the same shape of output a research desk would expect from a backtest report.

Backtest engine & Monte Carlo

The strategy graph is compiled into an executable form (lib/backtest/compile.ts), then simulated bar-by-bar (lib/backtest/run.ts) with standard metrics computed independently (lib/backtest/metrics.ts) so scoring logic stays decoupled from simulation logic. A Monte Carlo module (lib/backtest/monte-carlo.ts) resamples trade sequences to show a distribution of outcomes, not just the one historical path — the same instinct for "how fragile is this number" that IFRS valuation work requires.

Market data

Market data sits behind a provider interface (lib/market-data/provider.ts) rather than being called directly, so the Yahoo Finance implementation used today can be swapped for another vendor without touching the backtest engine. Results are cached in Postgres to cut outbound calls and keep repeat backtests fast.

Stack

  • Next.js 15 (App Router) + React 19 + TypeScript
  • Tailwind CSS v4 + shadcn/ui
  • Supabase (Auth) + Drizzle ORM (Postgres)
  • @xyflow/react — the strategy diagram canvas
  • technicalindicators — SMA, EMA, RSI, MACD, Bollinger, ATR
  • yahoo-finance2 — OHLCV market data, behind a provider interface

Live demo

A public read-only demo is planned — for now, reach out and I'll walk through it directly.