feat(chartctl): Chart Deployments — remote EA deployment over HTTP - #10
feat(chartctl): Chart Deployments — remote EA deployment over HTTP#10Marinski wants to merge 2 commits into
Conversation
90905af to
a960a7d
Compare
4110755 to
bdadec7
Compare
295c983 to
60932f3
Compare
Merge order: this one goes lastThese three were built in a sequence and should land in it:
All three are now rebased on current Merging this one before the other two would not break anything — but it makes the other two harder, because the overlap lands on them instead. This PR is the widest of the three (it touches What actually happens, rehearsed rather than assumedI merged all three locally in the order above:
So even in the right order this one needs a rebase once the first two land. The conflicts are all additive collisions, not semantic ones:
Every one resolves as a union. Nothing here disagrees about behaviour; the two features just grew into the same lines. I will rebase and force-push this within a few minutes of #16 landing, so it does not sit in a conflicted state. Ping me if you would rather I do it in a different order, or if you plan to merge this one first — the rehearsal is cheap to redo the other way round. |
60932f3 to
066666a
Compare
|
I verified One required packaging fix remains before merge. AutoIt's EULA permits redistribution, including inside another product, but requires every copy to include its copyright and trademark notices and a copy of the EULA. Please add the unmodified official AutoIt EULA and required notices under |
Attach Expert Advisors to charts with set files over the HTTP API. No RDP, no terminal restart, and nobody clicking through the Navigator. Stage `.ex5`/`.set` artifacts, declare deployments (expert + set + symbol + timeframe) as desired state, and a resident loader EA reconciles the terminal's charts to it. New endpoints: `POST/GET/DELETE /experts`, `POST/GET /sets` + `GET /sets/<name>`, `POST/GET /deployments` + `GET/PATCH/DELETE /deployments/<id>`, `POST /deployments/reconcile`, `GET /charts`, `GET /loader`, `POST /charts/<id>/screenshot`, `POST /charts/<id>/close`. Chart Control Protocol v1 is a file-based contract in `MQL5\Files\chartctl\` (`desired.json` / `observed.json` / command channel), documented in docs/chart-control-protocol.md. A deployment only reports `running` once the loader confirms the expert is live on a chart, so the status reflects the terminal rather than the request. Drift and failures surface in `observed.json`. Ships a reference loader (`assets/experts/MT5ChartLoader.mq5`) plus a portable include so an existing resident EA can adopt the protocol with three calls instead of running a second EA. A terminal GlobalVariable mutex makes co-existence and duplicate launches safe. OPT-IN. `chartctl.enabled` defaults to false. Enabling it writes a `[StartUp]` section into every live terminal's INI so the loader attaches at launch - fleet-wide behaviour that has to be asked for, never inherited by upgrading. With the block absent nothing changes and the endpoints return 404. Any single terminal opts out with `chartctl: false`. WebRequest allowlist provisioning (`GET`/`PUT /webrequest`, `POST /webrequest/apply`) sets the terminal's allowed-URL list over the API instead of the Options dialog. Two apply paths, chosen at runtime: on this Windows build the list lives in machine-bound `MQL5\experts.dat` and is dropped on every restart, so a bundled portable AutoIt interpreter drives the dialog and main.py re-applies the persisted list ~25s after each terminal start; on bare metal, where `common.ini` is the store, it encodes the list directly (format reverse-engineered from terminal64.exe and verified byte-identical against 18 real broker blobs). GUI applies serialize host-wide behind a named kernel mutex, since desktop focus is shared across terminals. All chartctl handlers are lock-free - pure file I/O against the terminal data dir - so they never queue behind the process-wide MT5 SDK lock. Tests: chartctl units, endpoints, and webrequest, plus a Python fake loader that plays the EA side of the protocol so the endpoint suite runs on Linux with no MT5. 484 passing.
…binary
AutoIt's EULA permits redistribution, including inside another product,
on the condition that every copy 'should include all copyright and
trademark notices, and shall be accompanied by a copy of this EULA'.
The bundled AutoIt3_x64.exe met the provenance bar (byte-identical to
the official portable archive, verified independently on both sides of
review) but shipped bare of both.
assets/autoit/ now carries:
- EULA.htm - the official EULA, verbatim as published by the AutoIt
Team in the AutoIt v3 documentation, matching the release the binary
ships in. Not retyped or reformatted.
- NOTICE.txt - the copyright notice taken from the binary's own version
resource ('(c) 1999-2025 Jonathan Bennett & AutoIt Team'), the
trademark notice from autoitscript.com, provenance (version, sha256,
source archive), and a line making clear the .au3 scripts beside it
are this repository's own, not AutoIt's.
binaries.lock.json's provenance note is updated to record that the
'no vendor-published hash' caveat no longer stands alone: the file has
been verified byte-identical to the official archive, and the EULA and
notices are named as the redistribution terms. docs/chart-deployments.md
points at NOTICE.txt where the bundled interpreter is introduced.
4cabf5d to
4eae86b
Compare
|
Done in
While there I re-downloaded the official portable archive and confirmed the same byte-identity you did ( Merge order#15 → #16 → #18 → #10 — this one last, as before. It is the widest of the four and shares |
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