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

 

I've been using a similar config loader architecture for multi-symbol/strategy EA's, initially as a solution to a cluttered EA Input Dialog Menu, especially with multi-symbol programs.
But I've only been using a .mqh file as the store with a config loader class to work with loading parameters during initialization/runtime.

Do you think using JSON provides added benefits, perhaps down the line when scaling?

 
Very interesting article. I personally use CSV, as you mention it is awkward, but if you use Excel or another sheet software you may configure many lines very easily. I use it mostly to run several instances of the same strategy using only one chart separated by magic numbers, it works well for forward testing, so you can run multiple configurations of the same strategy in parallel more easily.