All projects
02 / Multi-Agent Trading Paper Trading

Trading
Bot

I kept making emotional trades. Read some bad news, panic-sold. Saw a dip, bought too early. So I built a system that removes me from the equation.

0Leverage
20Tickers tracked
4AI agents
1:2Risk-reward
Scroll
Backtest Report / FTSE 100 Multi-Agent Strategy
1 Sep 2025 to 28 Feb 2026 (120 trading days)
Dummy Data Paper Trading
Total Return
+18.4%
Win Rate
67.2%
Sharpe Ratio
1.84
Max Drawdown
-6.3%
Total Trades
134
Avg Hold
3.2h
Equity Curve
Monthly Returns
SepOctNovDecJanFeb
Return+1.8%+3.4%-0.6%+4.2%+2.8%+4.8%
Trades182419282223
Win %61%71%53%75%68%72%
Max DD-2.1%-1.8%-6.3%-0.9%-1.2%-1.5%
Recent Trades (last 8)
DateTickerSideEntryExitP&LHold TimeClaude Rating
28 FebAZNLONG11,842p12,118p+2.3%2h 41m4/5
28 FebSHELLONG2,634p3,591p-1.6%4h 12m3/5
27 FebLSEGLONG10,440p10,622p+1.7%3h 08m4/5
27 FebRR.LONG624p637p+2.1%1h 55m5/5
26 FebULVRLONG4,218p4,184p-0.8%5h 30m3/5
26 FebBA.LONG528p541p+2.5%2h 20m4/5

Backtest performance across 120 trading days Dummy Data

FTSE 100 Backtest
Dummy Paper
Total Return
+18.4%
Win Rate
67.2%
Sharpe Ratio
1.84
Max Drawdown
-6.3%
Total Trades
134
Avg Hold
3.2h
Full terminal view best viewed on desktop
Algorithmic Trading /FTSE 100 /Claude Opus /Paper Trading /Four Agents /Python /Risk Management /Intraday Only /Algorithmic Trading /FTSE 100 /Claude Opus /Paper Trading /Four Agents /Python /Risk Management /Intraday Only /
01 / The Problem

I studied Financial Markets at Jai Hind College and got my Chartered Wealth Management certification. I understood markets. But understanding them and trading them profitably turned out to be two different things. I'd watch a stock I'd researched all week tank 2% on a single RNS announcement and sell within five minutes, then watch it recover by close. I'd spot a FTSE dip and buy in, convinced it was the bottom, only for it to keep sliding. After a red day I'd jump into something I hadn't even properly analysed, just to try and make the loss back. The analysis was usually fine. It was the real-time decisions that killed it. I'd override my own rules the moment I felt any pressure. So the question became: could I build something that kept the analysis but removed me from the execution?

02 / How It Works

Four-agent pipeline

Every weekday at 10:35am GMT, thirty minutes after London open, once the opening noise has settled, the system runs. No human input. APScheduler fires five jobs throughout the day. Nothing is held overnight.

10:30 Start candle collection via Lightstreamer
10:35 Full 4-agent evaluation scan
12:00 Regime recheck: close if FTSE <-1%
14:00 Second regime recheck
16:00 Liquidate everything, nothing overnight
Kill-Switch
Check equity floor (£750)
Market Regime
FTSE down >0.5%? Skip session
Parallel Scan
20 tickers + RNS news (Tier A/B/C)
Technical Indicators
EMA-50 + VWAP + RSI-14
Claude Quality Gate
Sonnet rates setup 1--5
Claude Risk Audit
Opus approves or vetoes
Execute or Kill
SL 3% / TP 6% / max 1 position
16:00 Liquidation
Nothing held overnight
trading-bot : scan output
10:35:01 SCAN Kill-switch OK: equity £2,847
10:35:02 SCAN FTSE 100: +0.12%, session active
10:35:04 PASS AZN: EMA OK, VWAP OK, RSI 42
10:35:04 SKIP SHEL: RSI 78 (overbought)
10:35:04 SKIP ULVR: below EMA-50
10:35:05 CLAUDE AZN rated 4/5, clean setup
10:35:06 AUDIT Opus approved, low correlation risk
10:35:07 EXEC BUY AZN @ 11,842p | SL 11,487 / TP 12,553

First thing every morning: kill-switch and market regime check. If either fails, nothing else runs. RNS news gets scanned via Claude web search, headlines classified as Tier A (earnings, M&A), B (buybacks, upgrades), or C (skip). This replaced a BeautifulSoup scraper that kept breaking. Then the technical check: EMA-50, VWAP, RSI. Only stocks that pass get sent to Claude Sonnet for a quality rating, strict JSON schema, no fallback. Last step is Claude Opus as risk auditor. The hard rails live in code, not prompts: £750 max notional, one position at a time, equity above floor. If Opus vetoes, the trade dies. Running paper-trade on a demo account while I wait for enough data to trust it.

03 / Features

Hard Rails

Every risk parameter lives in config.py, not in a prompt. £750 max notional per trade. 3% stop loss, 6% take profit, a 1:2 risk-reward ratio. One position at a time. Kill-switch at £750 equity floor. If it triggers, everything liquidates and trading stops until I manually reset it. Zero leverage. The agents can assess and recommend. They cannot override the code.

Structured Outputs

The quality gate used to run on OpenAI's o1-mini. If the JSON response failed to parse, there was a fallback that defaulted the quality score to 3, a safety hole that could let marginal trades through. Switched to Claude Sonnet with structured outputs and a guaranteed JSON schema. No parse failures, no fallback needed. Single vendor now. System prompts are cached across parallel scans for about 90% token savings.

RNS Scanning

Each ticker gets its RNS checked before the technical scan starts. Claude web search queries Investegate and the London Stock Exchange for same-day announcements published after 08:00 GMT. It finds the news and classifies it in one API call: Tier A (earnings, trading updates, M&A, CEO changes), Tier B (analyst upgrades, buybacks, regulatory approvals), or Tier C (director dealings, AGM notices, dividends). Falls back to a BeautifulSoup HTML scraper if the API is unavailable.

Multi-Scenario Backtesting

60-day default, up to two years. Walk-forward simulation that evaluates at 10:35 GMT on each historical trading day, no lookahead bias, 0.2% round-trip spread cost deducted. Reports break down per-ticker win rate, average win/loss, net P&L, annualised Sharpe, max drawdown, consecutive losses, and why each trade exited. All historical data cached as Parquet via yfinance across 20 FTSE 100 tickers.

Intraday Only

Evaluation at 10:35. Regime re-checks at 12:00 and 14:00. If the FTSE drops below negative 1%, open positions get closed. Everything liquidated at 16:00 regardless. No overnight gap risk. Spread betting through the IG API, so positions settle daily.

Atomic State & Auto-Deploy

A file-locked StateManager handles session state. The order manager and kill-switch both read and write session_state.json, and filelock prevents race conditions on concurrent edits. Every decision writes to a JSONL audit trail with timestamp, session ID, stage, ticker, and outcome. Oracle Cloud Ubuntu VM with systemd service. GitHub pull every five minutes, automatic restart on changes. Secrets stay in .env files that never touch the repo.

04 / In Action

Backtest results

Trading bot backtest report showing equity curve, monthly returns heatmap, and trade log
Backtest ReportPaper Trading
Multi-scenario backtest report: equity curve, monthly returns, trade log
05 / Tech Stack
Python
7,000+ lines across 33 files
Claude Opus
Risk auditor, final veto gate
Claude Sonnet
Quality assessment, structured outputs
IG Broker API
Order execution & market data
Lightstreamer
Real-time 5-min candle streaming
pandas-ta
Technical indicator library
APScheduler
Weekday-only job scheduling
yfinance
Historical data for backtesting
matplotlib
Backtest report charts
Oracle Cloud
Ubuntu VM, systemd auto-deploy
Tenacity
Exponential backoff retry logic
filelock
Atomic state persistence
More Work
OpsPilot dashboard
Production

OpsPilot

The same obsession with automation, applied to business ops. 60k lines of Python running 24/7 in production.

View case study
WhatsApp Smart extension
Prototype

WhatsApp Smart

Consumer product, not enterprise. TypeScript/React Chrome extension with local-only AI processing.

View case study
Uni-Nation website
Live

Uni-Nation Digital

Not AI, but the same end-to-end thinking. Family textile business taken digital from scratch.

View case study

The analysis was usually fine. It was the real-time decisions that killed it.