In early 2025, CFIN made a pivotal architectural decision: we retired the monolithic MQL5 Expert Advisor codebase that had powered Project Amber. In its place, we built Project Green—a decoupled asynchronous execution pipeline that transformed our trading platform and cleared the path for Project Iris.
The Limits of Terminal Monoliths
Expert Advisors written in MQL4 and MQL5 are fantastic for single-machine prototyping. However, as CFIN grew to serve institutional clients and thousands of automated trade events, the terminal-bound architecture created severe technical bottlenecks:
- Lack of Modern Concurrency: MQL5 scripts run synchronously inside the terminal thread. If an external API or file read stalls, execution latency spikes.
- Database Fragmentation: Storing high-frequency tick histories and trade telemetry inside flat CSV files or terminal SQLite databases made real-time multi-user analytics impossible.
- Security Isolation: Storing proprietary mathematical models directly inside compiled
.ex5binaries exposed IP to reverse-engineering risks on client-hosted VPSs.
The Breakthrough: Decoupled Python & ZeroMQ IPC
With Project Green, we inverted the hierarchy. The MetaTrader 5 terminal was stripped of its decision-making logic and transformed into a thin, ultra-fast execution bridge. The actual brains—signal detection, volatility analysis, portfolio risk balancing, and trade state machines—were moved into an asynchronous Python runtime backed by PostgreSQL and Redis.
# Project Green: Decoupled Async Decision Loop (Historical Archive)
import asyncio
import zmq.asyncio
async def execution_loop(market_feed, risk_engine, mt5_bridge):
# Sub-5ms decoupled evaluation loop introduced in Project Green (2025)
while True:
tick = await market_feed.get_next_tick()
# 1. Volatility and session check
if not risk_engine.is_session_open(tick.timestamp):
continue
# 2. Asynchronous multi-stage evaluation
setup = await risk_engine.evaluate_candidate(tick)
if setup and setup.passes_correlation_gate():
# 3. Dispatch to MT5 execution gateway via IPC
order_packet = setup.build_order_packet()
await mt5_bridge.send_order(order_packet)
await asyncio.sleep(0.001)
Paving the Way for Project Iris
The decoupling pioneered in Project Green made everything that defines CFIN today possible: the real-time Apple HIG dashboard, instant trade notifications, automated Profit Vault sweeps, and the specialized GS (Gold), CFD, and FX engines of Project Iris. Understanding our roots in Amber and Green is understanding why Iris is engineered for rock-solid reliability.