Building a C# Add-On to Manage MetaTrader Optimizations
Summary
This article describes the logic layer of a C# graphical add-on for managing optimization runs across multiple MetaTrader terminals. It organizes the application into classes for terminal configuration, directory structure, optimization reports, expert-advisor settings files, and the optimization manager, building on an earlier installment about launching a terminal from the console.
The examples cover wrapping terminal configuration and process operations, parsing IPv4 server addresses and ports, and using Windows API functions to read and write INI files. The article explains how the wrappers handle missing files, sections, keys, and deletion operations, then connects these components to GUI event handling and optimization management. It is software architecture and implementation guidance rather than a trading method or performance study. The author notes that the code could be improved, and the described address parser supports IPv4 only; the article provides no evidence that the add-on improves optimization quality or trading results.
Key ideas
- The add-on separates terminal operations, configuration, report parsing, settings files, and GUI logic into dedicated classes.
- A C# wrapper can launch and manage a MetaTrader terminal as an external process.
- Windows API profile functions are used to read and write INI configuration files from C#.
- The INI wrappers account for the API’s ambiguous missing-file, section, and key error behavior.
- The described server-address utility supports IPv4 formatting, and the author identifies room for further refactoring.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.