All work

Sentinel - trading strategy platform

A platform for systematic traders to prototype, backtest, and live-execute trading strategies - with multi-source composite scoring and the same code path from research to production.

Year
2025 - present
Stack
PythonFastAPIPostgreSQLTimescaleDBSQLAlchemyVueClaudeAlpaca API
SE
Sentinel - trading strategy platform

The problem

Most retail trading tools force a choice. Use a backtesting framework - your strategy lives in one mental model, designed for replaying historical bars. Use a live execution platform - rewrite the strategy in a different mental model, with different fee assumptions, different order types, different state machines. Each rewrite is an opportunity for the live behaviour to silently diverge from what the backtest promised.

The platforms that do try to unify both - QuantConnect, MetaTrader, the bigger institutional tools - are either prohibitive on cost, locked to a specific broker, or built around opinionated strategy DSLs that can't express the multi-source signal aggregation that real systematic strategies need.

Sentinel was built to remove the rewrite. From "idea" to "validated against four years of historical data" should take one CLI command. From validated to live paper trading should take a config flip. And the code path between those two states should be the same code path.

The approach

Sentinel is a Python + FastAPI backend with a Vue 3 dashboard, running on TimescaleDB. Three architectural decisions carry the platform.

One execution engine, two modes. A shared execution module models fees, slippage, partial fills, bracket orders (parent + take-profit + stop-loss as one atomic submission), and exit ladders. Both the live runner and the backtest replay engine call into the same module. The only difference between modes is the source of truth - Alpaca's API for live, OHLCV bar data for backtest. Same fee model, same lot-splitting, same exit logic. No drift.

One signal store, two query patterns. Every signal - from every source, for every asset, at every timestamp - lives in a single TimescaleDB hypertable keyed by (asset, source_id, ts). Backtest queries it with ts <= X to enforce point-in-time correctness - no future data leakage into historical decisions. Live queries it with latest. One data model serves both modes; backtest accuracy and live decision-making share the same source of truth.

Pure-function scorers, composable signals. Each signal source (RSI, MACD, fear-greed, Claude-calibrated news sentiment, etc.) is a pure function: given a context, return a (score in [-100, +100], confidence) tuple. The composite is Σ (source_score × weight × confidence/100), normalised against per-asset thresholds. Adding a new source is one scorer function plus one config entry - and it's immediately available in both backtest and live modes.

The Claude integration is worth calling out. Most LLM-driven sentiment work is classification ("bullish/bearish/neutral") - coarse, hard to weight, hard to debug. Sentinel uses Claude for calibrated numeric scoring: given a batch of news headlines for an asset, return a structured {sentiment: -100..+100, confidence: 0..100, reasoning: string}. The reasoning string is stored alongside every score for auditability - when a strategy fires on news sentiment, you can later read why the model scored it that way.

Operationally: GitHub Actions deploy to Hetzner in ~90 seconds via an idempotent deploy script. Postgres backed up daily to S3. HetrixTools monitoring with Slack alerts. A source_health table tracks every external integration's last-success time and rolling error rate, surfaced in the dashboard so a missing news feed or RPC outage is visible at a glance.

The outcome

Sentinel is in active development and running live in paper-trading mode against the Alpaca API. The first strategy validated through walk-forward analysis - an Opening Range Breakout strategy - is executing real bracket orders against current market data. Composite multi-source scoring runs across four crypto and four equity tickers, with 8 weighted sources per asset.

Three strategies have been built and evaluated to date: the ORB strategy (validated, live), Mean Reversion (rejected by walk-forward and shelved), and a Composite-stocks variant (validated with MACD-only and shelved pending source-mix tuning). The rejected results are kept in the engineering record - negative results are as informative as positive ones for strategy iteration.

Walk-forward validation across a four-year window with twelve splits and a full threshold grid runs in roughly five minutes. Roughly 38,000 signal rows are generated every 30 days. Nine external integrations are tracked live (FRED, Polygon, Etherscan, Helius RPC, news feeds, Reddit, Alpaca, Solscan, LunarCrush) with health visible in the dashboard.

Next: additional broker integrations, expanded asset classes, and an early-access program for systematic traders.

Next project

Offline-first POS for hospitality

Read case study