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.
System Architecture Pipeline
Read-only deal/order extraction via official MetaTrader5 Python API
Idempotent incremental trade synchronization without broker passwords
Reconstructs scale-ins, partial closes, R-multiples, drawdown, and session tags
Stores objective MT5 deals, reconstructed positions, and subjective journal reviews
Equity curves, Strategy Lab, Risk Guardian, Trader DNA, and Voice Journal
Architecture & Core Features
- •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
- •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
- •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
- 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
- • 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
- • 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