Quantum CodeQuantum Code
Back to Portfolio
Financial Engineering / Trading AnalyticsProduction • September 2026

Alpha Coach

Alpha Coach is an automated trading journal and quantitative performance operating system for MetaTrader 5 (MT5) traders. It connects to local MT5 terminals via a zero-password Python bridge, reconstructs multi-leg position lifecycles, and powers an executive dashboard, Strategy Lab, Session & Symbol Intelligence, Risk Guardian, and data-grounded AI Trading Coach.

01 • Problem Statement

MetaTrader 5 traders struggle to reconstruct multi-leg position lifecycles (scale-ins, partial closes, swaps, commissions) from raw terminal deal logs, while cloud journals often demand sensitive broker passwords.

02 • Deployment & Runtime

Vercel Production PWA & Serverless API Bundle backed by PostgreSQL / Supabase and SQLite support.

Integrations: MetaTrader 5 Python API • Supabase / PostgreSQL • Express & TypeScript API • WebSockets • Vite PWA

System Architecture Pipeline

Layer 01 • Desktop Terminal
MT5 Terminal + Python Bridge

Read-only deal/order extraction via official MetaTrader5 Python API

Layer 02 • Zero-Password Sync
TLS Device Pairing Auth (x-bridge-token)

Idempotent incremental trade synchronization without broker passwords

Layer 03 • Core Backend & Math
Express + TypeScript Reconstruction Engine

Reconstructs scale-ins, partial closes, R-multiples, drawdown, and session tags

Layer 04 • Data Persistence
PostgreSQL / Supabase & SQLite

Stores objective MT5 deals, reconstructed positions, and subjective journal reviews

Layer 05 • Analytics & AI OS
React 18 PWA + Grounded AI Coach

Equity curves, Strategy Lab, Risk Guardian, Trader DNA, and Voice Journal

Architecture & Core Features

Architectural Layers
  • •Zero-Password Local Python MT5 Bridge
  • •Rotating Device Pairing Token Auth
  • •Position Lifecycle Reconstruction Engine
  • •Express & TypeScript Backend API
  • •PostgreSQL & SQLite Persistence Layer
  • •React PWA Analytics Dashboard
Core Product Capabilities
  • •Automatic MT5 Deal & Position Lifecycle Reconstruction
  • •Executive Equity Curve, Drawdown & Expectancy Analytics
  • •Strategy Lab & Confluence Matrix
  • •Session & Symbol Intelligence Heatmaps
  • •Risk Guardian & Trader DNA Profiling
  • •Data-Grounded AI Trading Coach & Voice Journal

Engineering Challenges & Solutions

Key Technical Challenges
  • •Synchronizing desktop MT5 deal and order histories to the cloud without ever requesting or storing broker passwords
  • •Reconstructing complex positions (entry deals, scale-ins, partial exits, SL/TP hits, commissions, and swaps) idempotently without duplicate ingestion
  • •Ensuring the AI Trading Coach remains strictly grounded in empirical trade history rather than generic advice
Implemented Solutions
  • Engineered a local Python MT5 Bridge using official MetaTrader5 APIs authenticated via rotating Device Pairing Tokens (x-bridge-token) over TLS
  • Built a deterministic Position Reconstruction & Analytics Math Engine calculating weighted average prices, net P/L, Sharpe/recovery factors, and session classifications
  • Separated Objective MT5 Facts, Subjective Trader Reviews, and AI Inferences in the database schema with automated Jest and Python test suites

Requirements & Technical Governance

System Requirements
  • • Import up to 3 months of historical MT5 data and track new trades incrementally without duplicate ingestion
  • • Never ask for, receive, or store the trader's MT5 or broker password
  • • Accurately reconstruct multi-leg position lifecycles and compute institutional performance metrics
  • • Provide Strategy Lab, Session & Symbol Intelligence, Risk Guardian, and a data-grounded AI Trading Coach
Security, Performance & Observability
  • • Zero-password security model: read-only local terminal extraction authorized via rotating x-bridge-token headers
  • • Helmet security headers, rate limiting (express-rate-limit), JWT authentication, and Zod payload validation
  • • Idempotent batch deal ingestion and pre-computed position lifecycle aggregates
  • • Installable Progressive Web App (PWA) with fast client-side chart rendering
  • • Dedicated /health endpoint, bridge sync telemetry, and automated backend Jest + Python test suites

Verified Outcomes & Technology Stack

  • →Live production deployment at alpha-coach-pi.vercel.app with instant multi-asset demo dataset exploration
  • →Full automated Jest backend test suite and Python bridge verification suite
  • →Separating raw immutable broker deals from derived position lifecycles allows recalculating analytics safely as math models evolve
  • →Distinguishing objective broker data from subjective trader tags prevents AI coaching hallucinations
ReactTypeScriptNode.jsPythonPostgreSQLTailwind CSS