Two MetaTrader windows can look almost identical while using different account databases, chart profiles and EA folders. Add another Windows user, a tester copy and an old shortcut, and “the terminal on my VPS” stops being a precise target.
For an AlgoHand installation, the useful starting point is an inventory connecting each broker account to its executable, data directory and Windows session. Reinstalling the agent before establishing that mapping can preserve the same ambiguity under a new registration.
Give each terminal an identity beyond its window title
For two fictional demo terminals, write down a table like this:
| Item | MT4 demo | MT5 demo |
|---|---|---|
| Windows user | TradingUser | TradingUser |
| Installation | C:\Trading\MT4-Demo |
C:\Trading\MT5-Demo |
| Executable | terminal.exe |
terminal64.exe |
| Broker identity | DemoBroker-A plus its login | DemoBroker-B plus its login |
| Data directory | From File → Open Data Folder | From File → Open Data Folder |
| AlgoHand identity | Returned account_id
|
Returned account_id
|
The login and broker server belong together. A login number alone does not identify an account across every broker. Likewise, the executable path alone does not prove which account is connected now. Confirm the broker identity from a fresh terminal/manager report after any login change.
A PID helps identify a running process, but Windows can reuse it. Operational tools that later act on a process need additional identity checks, such as its executable and creation time. The inventory below is for inspection only.
Separate the installation and data paths
In MT5's normal mode, editable terminal data lives under the Windows user's profile. MetaQuotes documents that the data directory differs by Windows account and that origin.txt relates it to an installation. Use File → Open Data Folder in the actual terminal to inspect it. MT5 startup and data-directory documentation
Portable mode changes that arrangement by keeping data with the installation. It is a deployment choice, not a generic repair step. Adding /portable to an existing shortcut can make the terminal open a different set of local data instead of the profile the operator was using.
Choose the mode when provisioning a new isolated installation. For an existing setup, preserve its current mode until you have recorded and backed up the relevant configuration. Do not copy an active terminal's entire directory into a new location and assume account credentials, licensing and profiles will migrate correctly.
Inspect processes without stopping them
This PowerShell command lists candidate MT4 and MT5 processes:
Get-CimInstance Win32_Process |
Where-Object { $_.Name -in @('terminal.exe', 'terminal64.exe') } |
Select-Object ProcessId, SessionId, CreationDate, ExecutablePath
It does not print command-line arguments, which can contain private connection settings. Some fields can be unavailable without permission to inspect the process. An empty field is not evidence that the process is safe to remove.
Use Task Manager's Users and Details views to correlate the session IDs with their Windows users. Identify tester copies separately. A temporary Strategy Tester process is not another customer account that should automatically be enrolled for ordinary management.
Do not resolve a duplicate-looking list with a blanket Stop-Process terminal* command. Another Windows session may belong to somebody actively trading or testing.
Align discovery with the intended terminals
AlgoHand discovers terminal processes and their data directories. Discovery is not simply “manage whichever MetaTrader window is in front.” On a shared machine, another user's terminal can be relevant to the inventory even when it is invisible in the current RDP session.
The installation should therefore have an agreed operating Windows user and an explicit set of intended terminals. Compare that set with the agent's configured paths and newly discovered entries. Ambiguous data-directory matches need investigation; creating another VPS registration does not resolve which files belong to which process.
MT4 and MT5 also host their management components differently. MT5 normally uses a manager service. MT4 uses a manager EA on a dedicated chart. That manager chart is infrastructure: do not remove it while tidying up customer charts. The two platforms share the customer API, but a service check for MT5 is not a complete MT4 readiness check.
Validate the mapping before issuing commands
In AlgoHand, check each account's platform, broker server, login, VPS association, reported paths and observation time. Confirm that the expected manager is reporting. Show AutoTrading separately: OFF is an intentional switch state, not by itself a connection failure.
For the API, GET /v1/clients/{client_id}/state supplies this mapping. The compatibility fields mt5_login and mt5_server are used for both platforms; terminal.platform distinguishes them. Use the returned account_id for commands, then identify the particular EA through instance_id.
For a new installation, a useful acceptance check is:
- Both intended broker accounts appear with fresh observations.
- The installation and data paths match the inventory.
- Each manager reports from the intended terminal.
- The current AutoTrading setting matches the operator's choice.
- No unexpected old or tester terminal has been adopted into that working set.
Test the Windows lifecycle separately
Closing RDP, logging out and rebooting Windows are different events. A disconnected session can remain active, subject to Windows session policies; logging out ends that user's session. Microsoft documents how disconnecting differs from leaving an active remote session. Scheduled tasks must start the agent and terminals in the intended context after the relevant lifecycle event.
Test this on a dedicated demo setup. Observe what starts automatically after a fresh Windows sign-in before manually launching anything. Then check the same account identities and paths again. A manually repaired desktop is not evidence that unattended startup worked.
When an account is wrong, start with its process and data mapping. When an account is stale, investigate reporting as well. Keeping those two questions separate usually produces a more useful diagnosis than another installation attempt.
The shared account fields are documented in the AlgoHand API reference.
Top comments (0)