mt4_deploy
Idempotently deploy a strategy bundle to an MT4 terminal, updating only managed charts and experts while preserving other files.
Instructions
Deploy a strategy bundle to a terminal — idempotent, managed-subset.
Pushes pre-built charts + experts so the terminal's managed files match the bundle, while leaving foreign files (e.g. a watchdog's chart) untouched. This is apply-only: it does NOT select strategies, set lots/magic, generate charts, or compile — the caller owns the bundle's contents.
bundle is a LOCAL directory on this machine (read here and pushed over SSH —
NOT a path on the remote host). It mirrors the MT4 layout:
<bundle>/
profiles/default/<name>.chr # ready charts (one expert each)
MQL4/Experts/<folder>/<ea>.ex4 # the experts those charts referenceAlways run with dry_run=true first to preview the add/update/remove/foreign plan. Re-running the same bundle is a no-op (reports "no changes"). A terminal tagged env=live requires confirm=true. There is no rollback command: to recover, re-deploy the previous bundle (a pre-apply backup is also retained and is restored automatically if an apply fails).
reset_market_watch deletes symbols.sel in the stopped window (backed up first) so MT4 rebuilds Market Watch on the deploy's own start — caps unbounded symbol carry-over; it forces a stop/start cycle even with no file changes. After the restart, verify polls up to verify_timeout seconds rather than taking a single snapshot, so normal reconnect timing is not reported as a failed deploy.
Args: terminal: terminal id. bundle: local bundle directory path. dry_run: preview the plan without changing anything (no lock, no upload). confirm: must be true to deploy to a terminal tagged env=live. reset_market_watch: rebuild Market Watch by deleting symbols.sel while stopped. verify_timeout: seconds to poll post-restart health before reporting (default ~120).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| terminal | Yes | ||
| bundle | Yes | ||
| dry_run | No | ||
| confirm | No | ||
| reset_market_watch | No | ||
| verify_timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |