Skip to content
All library documents

Building a WPF GUI to Launch MetaTrader Optimization Across Terminals

Article MQL5 articles

Summary

This article explains how to build a C# and WPF add-on for launching Expert Advisor optimizations across multiple MetaTrader terminals on one computer. It reviews command-line launch arguments and INI configuration files, which let a terminal start with specified login, profile, portable mode, or tester settings. The GUI is structured around the MVVM pattern, with a View, ViewModel, and model interface connecting the interface to terminal functionality.

The article describes creating a WPF custom control library, organizing namespaces and styles, and using a connector DLL to display and operate the window within MetaTrader. It also outlines a way to test the interface separately by exposing internal classes to a test application and substituting a fake model. The demonstrated result is an interactive GUI and connector; the article does not explain the optimization logic itself or provide trading-performance evidence. That logic and interaction with files and terminals are deferred to a later installment.

Key ideas

  • MetaTrader command-line flags and configuration files can set terminal startup and tester options.
  • A WPF custom control library can package a C# interface for use as a MetaTrader add-on.
  • The MVVM pattern separates the GUI, its behavior, and the underlying model.
  • A connector class links the interface to MetaTrader, while a fake model supports isolated GUI testing.
  • The article covers interface construction rather than optimization logic or strategy results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.