val
About Work

AutoTrader back

AutoTrader is a personal project: a full algorithmic trading platform built on top of Interactive Brokers. It started as a way to automate some trading ideas and evolved into a serious, production-grade system.

AXL — A trading DSL

The core of AutoTrader is AXL, a declarative domain-specific language I designed for writing trading algorithms. Instead of coding strategies in PHP or Python, algorithms are written as .axl files with a clean, purpose-built syntax:

The AXL compiler is written in Rust across 5 crates (~15K lines): lexer, parser, validator, compiler, and a WASM target. The lexer handles Python-style indentation, the validator enforces a type system with series auto-dereferencing and null safety, and the compiler lowers everything to a JSON AST. That AST is then executed bar-by-bar by a PHP interpreter inside the trading engine.

The WASM build powers an in-browser code editor with real-time compilation feedback, so you get instant type errors and validation while writing algorithms.

AXL code editor with syntax highlighting
The AXL editor with syntax highlighting, algorithm browser, and language reference
AXL algorithm debug trace
Bar-by-bar debug trace of an AXL algorithm execution

Architecture

The platform runs as a microservices architecture orchestrated with Docker Compose:

Backtesting and optimization

The backtesting engine replays historical data bar-by-bar with realistic fill simulation, slippage, and commission modeling. Results are tracked with snapshots and displayed in the dashboard.

For parameter optimization, the platform uses Bayesian optimization via Optuna, allowing algorithms to be tuned across large parameter spaces. It also supports walk-forward validation — sequential train/test windows to guard against overfitting — and algorithm scans for multi-symbol, multi-timeframe optimization.

Bayesian optimization fitting run
A fitting run with Bayesian optimization across multiple rounds

The dashboard

The React frontend provides real-time monitoring of positions, orders, and P&L through WebSocket connections. It also exposes the algorithm library with the integrated AXL editor, backtest history, scan results, and optimization runs.

Backtest session with equity chart
Backtest session with equity chart, orders, and performance metrics

This project is where I push my technical boundaries. Building a compiler from scratch in Rust, designing a type-safe DSL, running distributed microservices, real-time data processing, ML-adjacent optimization, and financial modeling — all in one system. It runs in paper trading mode by default, with live trading infrastructure ready to go.