Skip to content
Back to work

Personal project · 2026

Runs locally

Trading Desk

Rule-based trading signals, live position tracking and AI review for gold, GBP/USD and Bitcoin

  • Next.js 16
  • React 19
  • TypeScript
  • Prisma 7
  • Neon Postgres
  • Zod
  • Recharts
  • Tailwind CSS 4
  • Gemini API
  • Ollama
  • FinBERT
  • Finnhub WebSocket
  • Telegram Bot API
  • macOS launchd
Trading Desk cover

Overview

What this is

A private trading desk for gold, GBP/USD and Bitcoin that runs six rule-based strategies around the clock on a dedicated Mac. It sends the trader Telegram alerts with exact levels and the next action to take, and tracks every open position from a live price stream. Every strategy, and every change to one, is tested on three years of history against fixed pass-or-fail checks before it goes live. AI models give an advisory second opinion that the code checks against the facts before anyone sees it.

The problem

What needed solving

  • Trades are placed by hand, so every alert has to say exactly what to do and when, or the trade is missed.
  • Signals arrived late: a scan every five minutes and a data cache out of step with the market meant entries landed 7.1 minutes after the price bar that triggered them, on average.
  • A free market-data plan of 800 requests a day had to serve the charts, the strategy scans and the research.
  • Most trading ideas look convincing on a chart and fall apart when tested on data that wasn't used to choose them.

The solution

What I built

  • Alerts in two stages: a warning while a setup is forming, then the entry with its levels and a one-line instruction.
  • Scans run every minute and fire within seconds of a price bar closing, and open positions are checked against a live price stream every 2.5 seconds.
  • One live price feed builds every chart timeframe once. The charts and strategies read the same data, and the paid provider only fills in history and repairs gaps.
  • A fixed research method for every change: fit the rule on the first half of three years, confirm it on the second half, and require statistical evidence before it ships.

Features

Key features

Six strategy books, three markets

Range breakouts, a Bollinger band ride, a Donchian channel and a swing system on gold, GBP/USD and Bitcoin.

Live price stream and shared bar store

WebSocket ticks build 1-minute to 4-hour bars once. Bars the feed didn't fully watch are never used.

Two-stage Telegram alerts

A warning while a setup forms, then the entry with its levels and next action, then every exit.

AI second opinion, checked in code

Gemini reviews each signal; code checks its verdict against computed facts. Ollama and FinBERT back it up.

Position tracking at stream speed

Stops, targets and trailing stops checked every 2.5 seconds from an in-memory position cache.

Trading console

Built from a Claude Design spec: next action per position, live multi-timeframe chart, phone layout.

Official economic calendar

Release times from the Fed, BLS, BEA and Bank of England. Fed dates parsed by code, changes flagged.

Research pipeline with fixed pass marks

Held-out data, resampling, cost sweeps and best-trade checks. A weekly job proposes, never applies.

Built to keep running through outages

Falls back to live-feed bars when the provider is down; a daily budget protects the data allowance.

Screens

Console: open positions with their next action, above the live chart (sample data)
Console: open positions with their next action, above the live chart (sample data)
A position's entry, stop and targets drawn on the live GBP/USD chart (sample data)
A position's entry, stop and targets drawn on the live GBP/USD chart (sample data)
Gold on 5-minute bars with swing, liquidity and structure overlays (sample data)
Gold on 5-minute bars with swing, liquidity and structure overlays (sample data)
Setup warnings and the AI's second opinion on each entry, with reasons for and against (sample data)
Setup warnings and the AI's second opinion on each entry, with reasons for and against (sample data)
The same console on a phone (sample data)
The same console on a phone (sample data)