feat(chartctl): Chart Deployments — remote EA deployment over HTTP - #10
Draft
Marinski wants to merge 1 commit into
Draft
feat(chartctl): Chart Deployments — remote EA deployment over HTTP#10Marinski wants to merge 1 commit into
Marinski wants to merge 1 commit into
Conversation
Marinski
force-pushed
the
feature/chart-deployments
branch
from
July 30, 2026 21:27
8a4b7da to
90905af
Compare
Attach Expert Advisors to charts with .set files over the HTTP API — no RDP, no terminal restart, no manual chart work. The API stores the desired state and a resident Loader EA inside the terminal reconciles charts to match, reporting the observed state back; a deployment only reaches `running` after the Loader confirms the EA is live on a chart. New endpoints (gated by `chartctl.enabled`, routes omitted when disabled): - `/experts`, `/experts/<hash>` — stage, list, remove EA .ex5 files - `/sets`, `/sets/<name>` — stage, list, inspect .set files (parsed inputs) - `/deployments`, `/deployments/<id>` — create, list, inspect, pause/resume, change set, delete - `/deployments/reconcile` — force an immediate reconcile - `/charts`, `/charts/<id>/screenshot`, `/charts/<id>/close` — live inventory and chart control - `/loader` — Loader EA status and version - `/webrequest`, `/webrequest/apply` — WebRequest allowlist provisioning Includes: - `mt5api/chartctl/` — paths, setparse, tpl_builder, registry, command - `mt5api/handlers/chartctl.py` + `webrequest.py` — lock-free REST surface - `mt5api/chartctl/autoit_webrequest.py` — AutoIt GUI automation; two runtime paths chosen automatically (AutoIt on the Windows VM, common.ini encoding on bare metal) - `assets/experts/MT5ChartLoader.mq5` + `include/ChartControl.mqh` — reference Loader EA (~60 lines) and portable protocol include - `assets/autoit/` — AutoIt interpreter and GUI automation scripts - `scripts/compile-chartctl-loader.bat` — zero-touch bootstrap compiler; on boot it compiles the Loader in every broker base, propagates the .ex5 to every terminal instance, and `config_helper.py write_ini` adds `[StartUp] Expert=` so the Loader auto-attaches. Disable per terminal with `chartctl: false`. - `scripts/webrequest_allowlist_codec.py` — allowlist codec - `docs/chart-control-protocol.md` — full protocol specification - `examples/chartctl/deploy.sh` — runnable deployment example - Tests: 43 chartctl tests (units + endpoints, with a Python fake_loader for Linux CI, no MT5 dependency) plus 35 WebRequest tests Rebased on current master; single commit.
Marinski
force-pushed
the
feature/chart-deployments
branch
from
August 5, 2026 10:49
90905af to
a960a7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chart Deployments (chartctl)
Chart Deployments (chartctl) lets you attach Expert Advisors to charts with
.setfiles over the HTTP API — no RDP, no terminal restart, and no manual chart work.The API stores the desired state, while a resident Loader EA inside the terminal reconciles charts to match that state and reports the observed state back. A deployment only reaches the
runningstate after the Loader confirms the Expert Advisor is actually live on a chart.New Endpoints
POST/GET/DELETE/experts,/experts/<hash>.ex5filesPOST/GET/sets,/sets/<name>.setfiles (returns parsed inputs)POST/GET/deploymentsGET/PATCH/DELETE/deployments/<id>POST/deployments/reconcileGET/chartsGET/loaderPOST/charts/<id>/screenshotPOST/charts/<id>/closeGET/PUT/webrequestPOST/webrequest/applyWhat's Included
mt5api/chartctl/— paths, setparse, tpl_builder, registry, commandmt5api/handlers/chartctl.py— lock-free REST surface, gated byCHARTCTL_ENABLED(config-driven; routes are omitted when disabled)mt5api/handlers/webrequest.py— WebRequest allowlist provisioningmt5api/chartctl/autoit_webrequest.py— AutoIt GUI automationassets/experts/MT5ChartLoader.mq5— reference Loader EA (~60 lines)assets/experts/include/ChartControl.mqh— portable protocol includeassets/autoit/— AutoIt interpreter and GUI automation scriptsscripts/compile-chartctl-loader.bat— zero-touch bootstrap compilerscripts/config_helper.py—write_iniemits[StartUp] Expert=and provides thechartctl_enabledquery commanddocs/chart-control-protocol.md— complete protocol specificationtests/test_chartctl_units.py+tests/test_chartctl_endpoints.py— 43 tests plus a Pythonfake_loaderfor Linux CI (no MT5 dependency)tests/test_webrequest.py— 23 tests covering the allowlist codec and endpointsexamples/chartctl/deploy.sh— runnable deployment exampleZero-Touch Bootstrap
No RDP step is required.
On VM boot:
compile-chartctl-loader.batcompiles the Loader in every broker base using MetaEditor64..ex5is propagated to every terminal instance.config_helper.py write_iniadds a[StartUp]section tomt5start.ini.The Loader automatically attaches when the terminal starts.
To disable this behavior for a specific terminal, set:
How It Works
The Loader polls
desired.json, reconciles the desired state with actual charts, writesobserved.jsonso the API knows what is actually running. All handler endpoints are lock-free and perform only file I/O.WebRequest Allowlist
Two application methods selected automatically at runtime: AutoIt GUI automation (Windows VM) or
common.iniencoding (Bare Metal).Changelog
See the
CHANGELOG.mdUnreleased section for the complete list of changes.Testing