Skip to main content
Trading, FinTech & Analytics — Case Study

Trading Bot with MT5

The client was a small prop trading desk running roughly four discretionary strategies in parallel across forex and CFDs. The team had been operating through the standard MT5 client with manual execution, which capped strategy count at what the human operators could monitor simultaneously and produced inconsistent execution quality on volatile sessions. The principal trader had a list of seven additional strategies that backtested well but could not be operationalized without execution infrastructure.

+20%execution efficiency
10strategies live
1sdashboard refresh
0manual executions
Trading Bot with MT5
Category

Trading, FinTech & Analytics

Industry

Trading/Finance

Timeline

11 weeks from kickoff to ten strategies live

Team size

4 specialists

Project Overview

The full story

The practical problem was twofold. Execution quality varied with operator attention, especially across overlapping sessions in London and New York, which meant entry slippage on the backtest-to-live transition often erased the edge that justified running a strategy. And the desk had no consolidated view of risk across strategies — each was monitored in its own window, so position sizing and correlation across strategies was eyeballed rather than measured.

We built a multi-strategy execution engine on top of the MT5 API that ran each strategy as an independent module with its own parameters, position sizing, and risk limits, all consolidated under a cross-strategy risk manager that enforced desk-wide exposure limits in real time. Strategy parameters were exposed as live controls that the principal could tune without code changes, and an analytics dashboard rendered fills, slippage, and per-strategy P&L on a one-second refresh.

What shipped was a desk-class trading workstation where the operator selects which strategies are live, monitors all ten on a single screen with consolidated risk metrics, and intervenes on individual strategies with parameter changes or pauses without affecting the others. Backtest-to-live slippage dropped substantially, the desk operationalized six of the seven shelved strategies within the first quarter, and the principal stopped manually executing entirely except during off-system anomalies.

The Problem

Manual execution capped strategy count and produced session-dependent slippage that erased backtest edge.

01Friction point

Operator attention across overlapping London and New York sessions caused entry slippage that consumed the backtest edge on volatile days.

02Friction point

Seven backtested strategies sat on the shelf because the desk could not operationalize them under the manual execution model.

03Friction point

Cross-strategy risk was eyeballed across separate MT5 windows, so position sizing and correlation went unmeasured during volatile periods.

04Friction point

Strategy parameter changes required code changes from the principal, who was already running execution, creating a single point of failure.

05Friction point

Slippage attribution per fill did not exist, so the desk could not diagnose which strategies were execution-bound versus signal-bound.

Our Approach

How we structured the engagement

Decoupled signal from execution, then built a desk-wide risk layer over the top so ten strategies could run together safely.

  1. Phase 01Weeks 1-2

    Discovery

    Sat with the principal for three trading sessions, instrumented the existing manual workflow for slippage per fill, and reviewed the seven shelved strategies for execution requirements. Output: a strategy module contract, a cross-strategy risk model, and a real-time analytics requirement at one-second refresh.

  2. Phase 02Weeks 3-4

    Architecture

    Designed a Python-based execution engine on top of MT5 with each strategy as an independent module sharing a common signal-to-order contract. Built a cross-strategy risk manager that enforced desk-wide exposure limits in real time. Used WebSockets to push fills and metrics into the React dashboard.

  3. Phase 03Weeks 5-9

    Build

    Shipped the execution engine and the strategy module contract first, ported two existing strategies to validate the contract, then built the risk manager and analytics dashboard in parallel. Implemented parameter hot-reload so the principal could tune strategy parameters mid-session without redeploying.

  4. Phase 04Weeks 10-11

    Launch

    Ran the engine in paper-trading mode for two weeks alongside the manual desk, compared fills and slippage attribution, then promoted to live with the two original strategies. Onboarded one additional strategy per week thereafter as the principal validated each against live performance. Reached ten strategies by week thirteen.

System Architecture

What we built, component by component

  1. 01

    MT5 connector

    Wraps the MT5 API with retries, latency monitoring, and reconnect logic, normalizing the broker interface for upstream modules.

  2. 02

    Strategy modules

    Independent Python modules per strategy with parameters, position sizing, and signal logic, conforming to a shared contract.

  3. 03

    Cross-strategy risk manager

    Real-time enforcement of desk-wide exposure, correlation, and drawdown limits across all running strategies.

  4. 04

    Parameter service

    Live parameter store with hot-reload, allowing mid-session tuning without redeploying any strategy module.

  5. 05

    Slippage attribution

    Per-fill slippage analysis with attribution to signal latency, broker latency, and market impact components.

  6. 06

    Real-time dashboard

    React workstation with one-second refresh on fills, slippage, and per-strategy P&L, plus consolidated desk risk view.

Data Flow

Each strategy module produces signals against the MT5 connector, the risk manager gates every order against desk-wide limits in real time, and the connector executes against the broker with latency monitoring. Fills flow back through slippage attribution into the dashboard at one-second refresh, and parameter changes from the dashboard propagate to strategy modules via the hot-reload parameter service.

MT5 connector
Strategy modules
Cross-strategy risk manager
Parameter service
Slippage attribution
Key Decisions

The trade-offs we made and why

Decision 01Lead trade-off

Decoupled signal generation from execution

Strategy logic and execution logic had different change rates and different failure modes. Decoupling them let the principal iterate signals without risking execution stability, and let us harden execution once for all strategies instead of per-strategy.

Decision 02

Built a cross-strategy risk manager from day one

A per-strategy risk model would have produced safe individual strategies and a dangerous desk. The cross-strategy view caught correlation spikes that would have blown through any single-strategy limit, and made it safe to onboard new strategies without rebuilding risk for each.

Decision 03

Implemented parameter hot-reload from the dashboard

Mid-session parameter changes were a real workflow need. Forcing a redeploy for every tweak would have killed the principal’s ability to react to regime shifts. Hot-reload kept the workflow fluid without compromising the deployment story for code changes.

Decision 04

Ran paper trading in parallel for two weeks before live

Trading systems fail in ways that backtesting never catches. Paper trading alongside the live manual desk surfaced two race conditions in order acknowledgment that we would not have caught in development, both of which would have caused real losses on day one of live trading.

Outcomes

What changed for the client

execution efficiency

Reduction in average slippage per fill across the strategy portfolio versus the prior manual-execution baseline.

strategies live

Concurrent live strategies running on the engine at peak, with the seven shelved strategies operationalized within a quarter.

dashboard refresh

End-to-end refresh from fill to displayed metric on the workstation, enabling real-time intervention without polling delay.

manual executions

Manual executions on the desk after week eight, except during off-system anomalies that required principal override.

Tech Stack

The tools behind the system

Built with a deliberate stack chosen for production reliability and operational velocity.

4 componentsProduction-grade
PythonMT5 APIReact.jsFastAPI
What we’d carry forward

Lessons learned from the build

01Lesson

The cross-strategy risk layer was the unlock for everything else. Without it, each new strategy onboarded would have required a new round of manual risk validation. With it, onboarding a strategy became a one-week task instead of a one-month task, which is what let the desk operationalize the shelved strategies in a quarter.

02Lesson

Paper trading in parallel was non-negotiable in hindsight. The two race conditions paper trading caught would have produced losses that exceeded the entire project cost on day one. Any future trading-system delivery would include a parallel-paper period of at least two weeks as a hard gate.

03Lesson

Slippage attribution turned out to be the most-watched metric on the dashboard. The principal used it to triage which strategies needed signal work versus execution work, which was a different question than they were asking before the system existed. We would design the attribution surface earlier next time.

Related Services

Similar delivery work usually starts in these service areas

If you are exploring a similar product, workflow, or implementation challenge, these are the service tracks that usually fit best.

Industry Context

Where this project sits in the bigger market picture

How we approach AI delivery for payments, banking, underwriting, and financial workflows.

Similar Project?

Build a result-driven AI product with a team that has shipped before

If you are exploring a similar product, workflow, or AI use case, we can help scope the right architecture, delivery model, and first milestone.

Start with clarity

Have an AI idea, messy workflow, or product vision? Let's make it buildable.

Bring the problem. We'll help shape the product, define the architecture, and show the fastest path to a serious first version.

  • A practical first roadmap in the discovery call

  • Architecture, timeline, and delivery options in plain English

  • Security, scalability, and reliability discussed upfront

Model registry

softus-rag-v4.2

live

187ms

Latency

128k

Context

$0.004

Cost / req

Evaluation suite

Faithfulness94%
Answer relevance97%
Citation accuracy99%

Deploy pipeline

prod / canary 25% — healthy