← Back to Work

Research entry

Algorithmic Trading System — Personal Hedge Fund

2026 · Independent Project

A multi-strategy algorithmic trading system running in dry-run on a Mac Mini. Three parallel strategies, an XGBoost signal confidence filter that doubles win rate, and a delta-neutral carry trade layer. Full monitoring via TimescaleDB + Grafana + Telegram.

Python XGBoost TimescaleDB Grafana Docker Crypto Machine Learning Bayesian

Open live app / source →

Overview

A personal algorithmic trading system targeting crypto perpetual futures markets. Three strategies run in parallel, each producing signals that pass through a shared XGBoost confidence filter before reaching the execution layer. Currently in dry-run on a Mac Mini with full production infrastructure in place.

Architecture

┌──────────────────────────────────────────────────┐
│  Strategy Layer                                   │
│  MeanReversionStrategy + VolRegimeStrategy +      │
│  FundingRateStrategy                              │
└──────────────────────┬───────────────────────────┘
                       │ signals

┌──────────────────────────────────────────────────┐
│  XGBoost Signal Confidence Filter                 │
│  Trained on 3,033 historical outcomes             │
│  Drops signals with confidence < 0.55             │
└──────────────────────┬───────────────────────────┘
                       │ high-confidence signals only

┌──────────────────────────────────────────────────┐
│  Execution + Carry Layer                          │
│  DryRunExecutor / HyperliquidExecutor             │
│  DeltaNeutralManager (long spot + short perp)     │
└──────────────────────┬───────────────────────────┘


┌──────────────────────────────────────────────────┐
│  TimescaleDB + Grafana + Telegram Alerts          │
└──────────────────────────────────────────────────┘

ML Signal Confidence Filter

The most technically interesting component. An XGBoost classifier trained on 3,033 historical signal outcomes with 18 features: price momentum at multiple timeframes, 24h volatility, funding rates, time-of-day (sin/cos encoded), and day-of-week.

MetricValue
ROC-AUC0.77
Win rate — no filter24%
Win rate @ 0.55 threshold~50%
Win rate @ 0.70 threshold71.4%
Top featuresvol_24h, threshold_used, hour_cos, dow, r_6h

The filter doubles win rate by refusing to forward low-confidence signals to the executor. The tradeoff is frequency — fewer trades, higher quality.

Strategies

Mean-Reversion — adaptive threshold that scales with 24h volatility (floor 0.6%, cap 2.0%, base 0.9%). SL=2%, TP=1.5%, max hold 6h, position size 5%, max 3 open positions. Symbols: BTC/USDT, ETH/USDT, SOL/USDT, DOGE/USDT, AVAX/USDT, LINK/USDT.

Vol-Regime — adjusts aggressiveness based on 24h volatility z-score. High-vol reversal: lower entry threshold by 30% when vol_zscore > 1.0. Vol-breakout long: momentum continuation when vol_zscore > 1.5.

Funding Rate — generates signals from funding rate z-scores over a 90-day rolling window. z > 2.0 → short (longs overpaying), z < -2.0 → long. Normalised signal strength: abs(z_score) / threshold.

Carry Trade Layer

A delta-neutral carry infrastructure runs alongside the directional strategies. Long spot (Binance) + short perpetual (Hyperliquid) = market-neutral exposure that captures the funding rate payment without directional risk.

  • FundingPositionManager — tracks 8h settlement events (00:00, 08:00, 16:00 UTC)
  • DeltaNeutralManager — monitors basis drift, emergency unwind at 1% basis
  • Currently dry-run enabled with max carry notional 10%, z-threshold 2.0

Monitoring

  • TimescaleDB — all trades, signals, equity snapshots, funding rates
  • Grafana — 3 dashboards: Portfolio Risk, Hedge Fund Overview, Crypto Reversal
  • Telegram alerts — drawdown > 5%, combined drawdown > 10%, bot health checks
  • Ireland CGT queries — FIFO cost basis SQL, per-trade CGT at 33%, annual summary

Infrastructure

All services containerised with Docker Compose on a Mac Mini:

ContainerPurpose
timescaledbPostgreSQL 16 + TimescaleDB
crypto-collector6-symbol 1m candles + 90-day funding rate backfill
crypto-bot3 strategies + ML filter
grafanaDashboards + Telegram alerts
polymarket-copy-botPolymarket copy trading (separate strategy)

Status

88 tests passing. Dry-run running continuously. Two-week validation period before going live with real capital.