← All work

Case study

AI Trading Software

A risk-free environment for testing trading ideas: live market data streams in, strategies and models produce signals, and every trade is simulated, tracked and scored.

Type
Personal R&D platform
Core
Python, multiprocessing, Flask + Queue
Data
Kraken market data, Pandas, NumPy
Models
TensorFlow
Dark trading simulation dashboard with a candlestick chart, buy and sell signal markers, a model-confidence chart, paper-trading balance and system module statuses
Illustrative view of the simulation dashboard.

Building a trading simulation

The project started as a simple strategy tester for the MACD cross, then grew into a broader trading simulation platform. The goal was a risk-free environment for testing ideas before considering live execution.

That meant building local streams for order book and OHLCVT data, then wiring those streams into a system that could evaluate signals, simulate trades and track results. Kraken was the primary data provider because its API made market data easy to retrieve for local testing.

System modules

As the project expanded, the architecture split into specialised modules that mirror pieces of an exchange-style backend. Each runs as its own process, and they talk through clear service boundaries.

Seven modules connected left to right by queues: Data Collection, Asset Data, Predictor, Exchange Portal, Position Evaluator, PnL Evaluator, Results Store
  1. Data Collection

    Streams real-time market data from Kraken.

  2. Asset Data

    Maintains historical and real-time market data.

  3. Predictor

    Processes historical data and generates trade signals.

  4. Exchange Portal

    Simulated trade execution through API-style interfaces.

  5. Position Evaluator

    Monitors open positions and risk rules.

  6. PnL Evaluator

    Calculates real-time profit and loss.

  7. Results Store

    Keeps trade outcomes for analysis and for the frontend.

The shift to machine learning

After testing several rule-based strategies, the project moved toward machine learning. TensorFlow was used to train and evaluate models against historical price data, simulated real-time streams and order book context.

The objective was never to promise profitable trades. It was to build a controlled environment for testing whether model-generated signals could adapt better than static strategy rules.

Live paper trading, and what's next

The current direction is live paper trading: real-time order book data and live market prices, with execution kept simulated. That keeps the work focused on validation, observability and risk control before any real capital is involved.

The main objective is to compare model behaviour in live conditions against backtest expectations, and to understand where the system needs stronger safeguards.

Technology

  • Multiprocessing runs independent modules in parallel.
  • Pandas handles data manipulation and analysis.
  • NumPy supports numerical computing on large datasets.
  • TensorFlow powers model training and signal experiments.
  • REST APIs connect components through clear service boundaries.
  • Flask + Queue coordinates communication between modules.
  • JSON handles serialisation and data exchange.