Skip to content
abin.th

Java · Trading infrastructure

Confidential client

Algorithmic Trading Platform

A Java platform for backtesting trading strategies and deploying them live through seven broker integrations.

Client and product names are withheld for confidentiality.

Broker integrations
7
Faster trade-feed delivery
5×
Faster backtests
6×

Problem

Strategies have to be tested against historical data before they go live, then run reliably against several brokers, each with its own API and behaviour.

What I built

  • Strategy backtesting
  • Live strategy deployment
  • Integrations with 7 brokers
  • Custom technical indicators
  • A redesigned WebSocket architecture for real-time trade feeds
  • Trading infrastructure and backend/system architecture

Technical highlights

  • 5× faster message delivery on real-time trade feeds after redesigning the WebSocket architecture
  • 6× faster backtesting: 5 years of hourly market data for 230 stocks in under 10 minutes, down from about an hour
  • Backtesting and live deployment in one platform
  • A broker integration layer spanning seven brokers
  • Custom indicator implementations for strategy logic

Key decisions

  1. 01

    One broker interface, seven adapters

    Each broker sits behind a shared interface with its own adapter. Orders, positions and quotes are normalised to one internal model, and each adapter handles its broker's authentication, session expiry, retries and errors. Strategies never need to know which broker they're trading on.

  2. 02

    Separate engines, same strategy code

    Backtesting replays historical market data candle by candle, and live trading runs on real-time data. They're separate engines, but both run the same strategy implementation, so what you test is what you deploy.

  3. 03

    A data store for each kind of data

    Java for strongly typed, calculation-heavy indicator code. MySQL for core relational records, MongoDB for flexibly shaped data like strategy configs, trade logs and broker responses, and Redis for fast access to live market data.

Hardest problems

  • Real-time reliability: live strategies must never miss a signal or place an order twice
  • Making custom indicators match expected values exactly
  • Making backtests reflect real trading conditions

Architecture

  1. Strategies & custom indicators
  2. Backtesting | Live deployment
  3. Messaging · WebSockets · RabbitMQ
  4. Broker integration layer
  5. 7 brokers

Stack

  • Java
  • Spring Boot
  • WebSockets
  • RabbitMQ
  • MySQL
  • MongoDB
  • Redis