Discussing the article: "Strategy Configuration via External JSON Files in MQL5: Replacing Input Parameters with a Runtime Config Loader"

 

Check out the new article: Strategy Configuration via External JSON Files in MQL5: Replacing Input Parameters with a Runtime Config Loader.

The article presents CJsonConfigLoader and a typed SStrategyConfig that move EA inputs to a shared JSON file. A hand-written, quote-aware tokenizer parses a flat object without any DLLs. A hotkey triggers reload so all instances can pick up new lot size, SL/TP, and spread limits without reattaching the EA. On malformed input, the loader falls back to safe defaults and keeps the previous configuration.

An Expert Advisor with strategy parameters baked into input variables is fast to write and easy to optimize in the Strategy Tester, but it has a hard operational ceiling. Any lot-size, stop-loss, or filter-threshold change requires either recompiling the .mq5 source or reopening the EA's input dialog on each chart. For a single instance on a single symbol this is a minor inconvenience. For traders running the same logic across many symbols or multiple risk variants, this becomes a coordination problem. There is no programmatic way to push changes to all running instances, no shared source of truth for the current configuration, and no way to apply updates without restarting or reattaching the EA.

Operationally, the issue is not compilation speed. The issue is that the Properties dialog is a manual, per-chart operation, even though it can change inputs without touching the source. There is no way to script it, no way to push one change to every running instance at once, and no shared file that all instances read from. A trader must open twenty dialogs and re-enter the same values, and each change still requires detaching and reattaching the EA on that chart. Recompilation only enters the picture when a trader wants to change a default value baked into the source itself, rather than a per-chart override.

Compiled Inputs vs. External JSON Config

Author: Ushana Kevin Iorkumbul