mt4_login
Performs a one-time headless login for a MetaTrader 4 terminal migrated to a new host, enabling automatic reconnection on restart. Requires confirmation for live terminals.
Instructions
Perform a one-time headless login so a migrated terminal can auto-reconnect.
Needed when a terminal was copied to a new host: MetaTrader's saved password is machine-bound and must be re-entered once. After this succeeds the unit auto-logins on every restart. Live terminals require confirm=true.
Args: terminal: terminal id. server: broker server name, e.g. "ExampleBroker-Demo". account: login number; defaults to the terminal's configured account. password: explicit password; otherwise resolved from env/secrets file. confirm: must be true to act on a terminal tagged env=live.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| terminal | Yes | ||
| server | Yes | ||
| account | No | ||
| password | No | ||
| confirm | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |