Member-only story
When Banks Become Trades: Building an Algorithmic EA from a 2025 Mathematical Finance Paper
Javier Santiago Gastón de Iriarte Cabrera24 min read·1 hour ago--
A particle system model of systemic bank risk — translated into MQL5 position management logic
This article is part of the Javier’s series on implementing academic quantitative finance papers as production-ready Expert Advisors for MetaTrader 5.
What if you managed your open positions the same way a central bank manages systemic risk across an entire financial network?
That is the somewhat absurd — and surprisingly workable — premise of this article.
In January 2025, a team of mathematicians published a paper in Mathematical Finance titled “Systemic Robustness: A Mean-Field Particle System Approach” (Bayraktar, Guo, Tang & Zhang, DOI: 10.1111/mafi.12459). The paper is dense, rigorous, and about banking contagion. It has nothing to do with trading EAs.
And yet, when you read it carefully, the mathematical skeleton maps almost perfectly onto portfolio-level position management. A bank that defaults is a trade that hits its stop loss. Contagion spreading through the network is correlated drawdown across open positions. The “economy drift” β that determines whether most banks survive is precisely the market edge you need for a strategy to be profitable at all.
Let us take the paper seriously and build the EA.