The Story Behind PMTS: 6 Years Building an Institutional-Grade AI Trading System
Today we publicly share for the first time the technical journey behind PMTS — the Professional Modular Trading System. What started as a personal research project in 2015 has evolved into a fully autonomous, institutional-grade algorithmic trading platform built from the ground up to trade XAUUSD (Gold) on MetaTrader 5.
This post is not a sales pitch. It is an honest account of the engineering decisions, the failures, the pivots, and the technical breakthroughs that shaped what PMTS is today.
The Problem We Set Out to Solve
The gold market moves over billion in daily volume. It is dominated by central banks, hedge funds, and institutional desks that operate with tools and information retail traders simply do not have access to. The average retail trader uses lagging indicators — RSI, MACD, moving averages — that show what already happened, not what institutions are about to do.
We asked a simple question: what if we could build a system that reads institutional order flow, not retail indicators?
That question led to six years of development.
Phase 1: Research and Indicator Optimization (2015–2017)
The first two years were pure research. We backtested over 40 technical indicators across 5 years of XAUUSD data (2010–2015), looking for combinations that produced statistically significant edge. Most individual indicators failed in isolation. The breakthrough came when we realized that confluence — the agreement of multiple independent signals — was the only reliable predictor.
We optimized 15 core indicators through walk-forward analysis:
- TEMA (16) — Triple Exponential Moving Average for reduced-lag trend detection
- SuperTrend (23, 2.0) — Trend continuation and reversal identification
- ATR (50) — Volatility-based stop-loss calculation
- Williams %R (17) — Overbought/oversold extremes and divergences
- EMA Triple Stack (18/30/290) — Short, medium, and long-term trend alignment
- MACD (17/27/13) — Momentum confirmation with custom parameters
- RSI Divergence Detection — Automated bullish/bearish divergence scanning
- Bollinger Bands — Volatility squeeze and expansion detection
- Fibonacci Retracements — Key levels at 0.236, 0.382, 0.5, 0.618, 0.786
Each parameter was optimized specifically for gold, not generic forex. Gold has unique characteristics: 10x higher pip value than major pairs, extreme sensitivity to FOMC and NFP data, and strong inverse correlation with the US Dollar.
Phase 2: The Modular Architecture (2017–2019)
The single biggest architectural decision was going modular. Instead of one monolithic trading bot, we designed PMTS as 7 independent, specialized modules — each one an expert in its domain:
- Trend Analyzer — Identifies macro and micro trend direction using multi-timeframe analysis and adaptive moving averages across 4 concurrent timeframes (1H, 4H, 1D, 1W)
- Smart Money Detector — Reads institutional accumulation, distribution, and liquidity sweep patterns. This module implements Smart Money Concepts (SMC): Order Blocks, Fair Value Gaps, Break of Structure (BOS), and Change of Character (ChoCH)
- Order Flow Scanner — Analyzes volume profile and detects large institutional positions entering the market
- Risk Manager — Calculates precise entry, stop-loss, and take-profit levels based on market structure and ATR-derived volatility, not arbitrary pip distances
- Correlation Engine — Monitors cross-asset correlations in real time: DXY (US Dollar Index), US Treasury yields, VIX (volatility), S&P 500, and Brent crude oil
- Sentiment Analyzer — Processes COT reports (CFTC institutional positioning), Fear & Greed Index, and news sentiment using Natural Language Processing
- Execution Optimizer — Optimizes entry timing within session kill zones, manages position sizing, and handles order management
The critical design principle: all 7 modules must agree before any trade is executed. No single module can override the consensus. This eliminates single points of failure and dramatically reduces false positives.
Phase 3: Multi-Timeframe Consensus (2019–2020)
We implemented a weighted multi-timeframe analysis system that processes 4 concurrent timeframes simultaneously:
| Timeframe | Weight | Purpose |
|---|---|---|
| 1H (Hourly) | 20% | Precise entry timing |
| 4H (4-Hour) | 30% | Intermediate trend confirmation |
| 1D (Daily) | 35% | Primary market direction |
| 1W (Weekly) | 15% | Macro bias context |
A STRONG signal requires 4/4 timeframes aligned. A GOOD signal needs 3/4. Below that, the system does not trade. This alone eliminated over 60% of losing trades in backtesting.
Phase 4: Risk Management — The Non-Negotiable Layer (2020)
2020 was the year that validated our risk-first approach. When COVID crashed gold from ,700 to ,450 in days, then rallied to ,075, systems without proper risk management were destroyed. Ours survived in backtesting because of three independent protection layers:
3-Tier Stop-Loss Protection
- Trade Level: ATR-based stops placed at logical structure levels where the thesis invalidates
- Daily Level: Maximum 5% daily loss — triggers automatic pause until next session
- Account Level: 15-20% maximum drawdown circuit breaker — all trading stops
Intelligent Trailing Stop (3 Levels)
- Level 1 (+300 points): Standard trailing with 1.5× ATR dynamic distance
- Level 2 (+150 points): Breakeven lock — moves stop to entry + 20 points guaranteed profit
- Level 3 (+500 points): Aggressive trailing with 1× ATR — protects large gains
Risk per trade is capped at 1% of account equity. No Martingale. No grid trading. No averaging down. Ever.
Phase 5: Smart Money Integration (2020–2021)
This was arguably the most transformative phase. We integrated Smart Money Concepts — the methodology used by institutional traders — into the algorithmic framework:
- Liquidity Sweeps: Detecting when institutions engineer stop-loss raids to accumulate positions at better prices
- Order Blocks: Identifying institutional accumulation and distribution zones that act as future support/resistance
- Fair Value Gaps (FVGs): Price inefficiencies that institutions use for precise re-entry
- Market Structure: Automated detection of Higher Highs/Higher Lows (uptrend), Lower Highs/Lower Lows (downtrend), Break of Structure (BOS), and Change of Character (ChoCH)
Every obvious support and resistance level on a chart is a liquidity magnet. When retail traders place their stops at these levels, they become part of the institutional trade. PMTS was designed to read this — not to be a victim of it.
The Technology Stack
PMTS is built on MetaTrader 5 using MQL5, chosen for its institutional-grade execution engine, sub-50ms order processing, and direct broker connectivity. The backend API is PHP with MySQL, serving real-time analytics, performance tracking, and user management.
The Expert Advisor architecture is fully modular: 16 specialized code modules organized into Analysis, Strategy, Risk, Trading, and Visualization layers. Each module can be independently tested, optimized, and deployed.
Backtesting Results and Honest Limitations
After 5 years of XAUUSD data (2019–2024 emphasis) and thousands of hours of optimization, the backtesting results show promise. But we want to be transparent about what backtesting is and what it is not:
What backtesting shows: Statistical edge across historical data, parameter sensitivity, drawdown profiles, and strategy robustness under various market regimes.
What backtesting does NOT show: Real slippage, requotes, varying spreads, broker execution quality, or black swan events that have no historical precedent.
We will not publish specific backtest numbers here because they can be misleading. Instead, we will publish verified live trading results once we have a statistically significant sample size — at least 6 months of real trading data.
Past performance, whether backtested or live, does not guarantee future results. Trading involves substantial risk of loss.
What Comes Next
We are currently preparing for live deployment. The system will trade real capital on regulated broker accounts, with full transparency:
- Live equity curves published on our dashboard
- Every trade recorded and auditable
- Monthly performance reports with verified data
- Independent code audit and security review
PMTS was not built to be another black-box trading bot. It was built to be a transparent, institutional-grade system that anyone can verify. The code has been reviewed. The methodology is documented in a 15,000-word technical whitepaper. And when we go live, the results will speak for themselves — or they will not.
That is the commitment we make.
This is the first post in a series documenting the technical evolution of PMTS. Follow our blog for deep dives into individual modules, trading methodology, risk management frameworks, and eventually — live performance analysis.
— Lorenzo Ballanti, Founder & Lead Developer, Elysium Media FZCO, Dubai
Ready to start trading with AI?
Join hundreds of traders using PMTS algorithmic trading technology
Get Started