ForexBestRobots.comCompare EAs →

VPS & MT4 STABILITY · GUIDE 2

How to Configure and Optimize MT4 on a VPS

Configure MT4 on a Windows VPS: separate terminals, measure CPU and RAM, tune charts and history, verify EA permissions, and test restarts and alerts.

13 min readReviewed by ForexBestRobots Editorial Team
A repeatable MT4 configuration cycle: map the workload, measure resource pressure, adjust one setting, then verify data, permissions and EA operation before keeping the change.MT4 configuration on VPSMeasure, adjust and verify

Configuration workflow; no capacity or performance benchmark.

A useful MT4 configuration has enough capacity for its real workload, keeps each trading instance identifiable, and survives routine maintenance with its intended settings intact. Tune the environment against observed resource pressure and verified EA behavior, rather than copying a universal “fast MT4” preset.

This is Guide 2 in the VPS & MT4 Stability series. The foundation guide explains hosting and continuity. For incident response, backups and restoration, use Guide 3: failures and safe recovery. For ongoing supervision between incidents, continue with Guide 4: EA monitoring, quotes and alerts.

Define what you are optimizing

This guide assumes MT4 and the intended EA are already installed and tested on demo. For file placement and attachment, use the EA installation guide. Integrated MetaTrader virtual hosting has a different migration workflow and no Windows desktop; do not apply Windows startup or folder instructions to it.

Operational optimization means reducing unnecessary load while preserving the EA’s approved behavior. It is different from optimizing strategy parameters in the tester. Do not alter lot size, signal filters, risk limits or execution settings to make a terminal appear more responsive. A lighter terminal does not establish profitability or guarantee execution.

Map the workload before changing settings

Record each terminal’s purpose and the components it actually needs. A chart count alone misses multi-symbol EAs and indicators calculated internally. One heavy EA can require more resources than several simple ones.

RecordWhat to include
Terminal identityInstallation path, actual data folder, Windows user and a clearly named shortcut.
Trading contextBroker account and server; demo, live or research role. Store credentials securely, outside the worksheet.
Active workloadRequired charts, exact symbols and timeframes, attached EAs, versions and approved Inputs.
DependenciesOther symbols/timeframes, lookback history, custom indicators, files, DLLs, permitted WebRequest URLs and licensing.
Ownership and operationsMagic Number scheme, existing orders to manage, startup method, monitoring destination and change date.

Keep the approved .set file where supported, plus a record of the current profile and configuration. This documents the baseline; it is not a complete backup or recovery plan.

Match VPS resources to observed demand

ResourceAssessConfiguration decision
CPUBusy periods, per-terminal demand and concentrated load on individual logical processors.Leave room for bursts. Shared vCPU count alone does not establish sustained capacity; compare the actual workload.
RAMWindows plus all terminals, chart data, indicators and background applications.Allow memory headroom. Growing memory pressure and paging need investigation; do not disable the page file as a tuning shortcut.
SSD / storageFree space, history and log growth, disk activity during scans, downloads and updates.Budget for the OS and maintenance as well as MT4. An SSD label does not prove adequate free space or disk performance.
WindowsCurrent security support, broker/EA compatibility, user session and provider management policy.Use a maintained, appropriately licensed environment. Confirm the actual edition and dependencies with the provider and vendor.
NetworkConnection to the intended broker server, interruptions and quote updates during relevant sessions.Investigate the broker route. A smooth Remote Desktop session or fast public speed test is insufficient evidence.

There is no reliable universal “EAs per GB” or “terminals per vCPU” rule. Decide capacity after observing the complete intended workload, including startup, history loading and maintenance. Resource headroom is an operating margin, not a promise of trading results.

Measure normal use and meaningful peaks

  1. Establish a baseline. Open Windows Task Manager with Ctrl+Shift+Esc. Inspect Processes or Details for each terminal.exe, and Performance for overall CPU, memory, disk and network activity. Match processes to the installation paths in your inventory.
  2. Observe several operating conditions. Include an ordinary trading period, faster quote flow, startup and data loading. Record the time, active configuration, resource pressure and whether MT4 remains responsive. A single idle screenshot is not a capacity test.
  3. Find the contributor. Compare terminal demand with other applications, updates and security scans. Overall CPU usage can hide a busy logical processor or a program bottleneck. Low overall usage does not prove every EA is processing promptly.
  4. Separate research load. Run lengthy backtests and parameter searches away from the trading workload where practical. A separate tester installation on the same VPS separates configuration but still competes for the same machine resources.

MQL4 EAs run in separate threads, while chart indicators share interface-thread resources; an indicator called through iCustom() runs in the caller’s thread. Events within an EA are handled sequentially. New ticks are not all queued while its OnTick() is already processing. Adding cores cannot automatically fix expensive logic or a stalled indicator; ask the developer about persistent program-level load.

Keep multiple MT4 installations identifiable

For simultaneous accounts, install the broker’s intended MT4 copies in different installation directories. Give shortcuts distinct names describing their roles. Two shortcuts pointing to the same executable path do not create two separate installations.

In every running copy, use File → Open Data Folder and record the resolved location. The normal data folder depends on the installation path and Windows user; its origin.txt identifies the associated installation. Do not guess the correct folder from a broker name, or assume that a different Windows user sees the same EA files and settings.

Install and verify each copy’s dependencies in its actual data folder. Separate folders reduce configuration mix-ups, but do not isolate broker-account exposure. An EA may also use shared files through FILE_COMMON or an external licensing service; follow its documented multi-instance rules.

Portable mode is not a speed setting. /portable changes where MT4 tries to store data. It does not automatically transfer an existing data folder and still requires write permissions. Keep the normal mode unless there is a tested reason to change it; do not disable UAC or broadly elevate privileges for convenience.

Separate order ownership from terminal capacity

Several EAs or terminals can operate on the same account only when their order-management rules are compatible. Record the documented Magic Number, symbol and any other ownership filters for every intended instance. Do not assume that an EA manages only its own orders.

A Magic Number is an order identifier, not a cross-terminal lock. Two copies can submit duplicate orders even with different identifiers. Before changing an identifier or moving an EA, check whether existing open and pending orders still require its management. Preserve the documented ownership needed to resume those orders. See the Magic Number guide for the detailed model.

Resource separation also leaves account risk shared: margin use and correlated positions can accumulate across EAs. Review that exposure through the risk-management guide; CPU headroom does not make the combined portfolio safe.

Tune charts and history without removing required data

Start by removing confirmed unused analysis charts and decorative indicators. Closing an EA’s chart unloads that EA; it is not the same as minimizing the window. Check what runs on a chart before closing it, and retain charts required by the documented setup.

In Tools → Options → Charts, distinguish Max bars in history from Max bars in chart. The first limits stored history; the second controls chart data used for indicator calculations. Reducing unnecessary chart history can lower resource demand, but an arbitrary small value can deprive an EA or indicator of its required lookback.

  1. Establish the minimum data needed for every required symbol and timeframe, including indicators calculated internally.
  2. Keep enough history for those requirements and for any intended validation. Do not assume one visible chart covers a multi-timeframe EA.
  3. Change one limit on demo, reload or restart as needed, and verify initialization, data availability and expected calculations before retaining it.

These limits are not a precise memory quota: chart bars can grow as new quotes arrive. Do not wipe the history folder to “speed up MT4”; reloading consumes resources and may change the available test data. Preserve the original dataset for comparisons.

Retain required symbols and indicator dependencies

In Market Watch, hide only symbols confirmed unused by the complete setup. MT4 documents this as a way to reduce quote traffic. Keep symbols needed for trading, cross-symbol signals or currency conversion, even when no visible chart shows them. MT4 also prevents hiding certain symbols with open charts or orders; the list is not a complete dependency audit.

Removing a displayed indicator does not prove that its calculations have stopped: an EA can request indicator values internally. Test optional dashboards and nonessential visual overlays separately, keeping the vendor’s required indicators and files. If CPU or memory steadily grows, collect timestamps and logs for the developer rather than masking the issue with frequent blind restarts.

Verify permissions for the actual trading copy

For ordinary Windows MT4, check both the terminal’s AutoTrading control and the attached EA’s Allow live trading permission. A visible EA icon, incoming quotes or a running process does not establish permission to trade. Confirm the intended account, server and trading access too.

Review the options that disable automated trading after an account, profile, symbol or timeframe change. They are protective controls, not switches to remove automatically. If one is triggered, verify the new context before re-enabling the intended EA.

Allow DLL imports only for trusted, required libraries, and allow WebRequest only to documented trusted URLs. Inspect the already attached EA’s own settings; changing defaults is not a substitute for verifying a running instance. Recheck after profile, template or EA updates. Turning AutoTrading off blocks EA trade operations in that terminal; it does not close orders or stop separately hosted copies.

Control log growth without destroying evidence

Inspect Experts for EA messages and Journal for terminal and connection events after every configuration change. From either tab, the context-menu Open command opens its log folder and flushes current entries to disk. In the actual data folder, EA logs normally reside in MQL4/Logs and terminal logs in logs, with dated YYYYMMDD.LOG files.

The tabs show recent entries; Clear clears their display, not the physical files. For disk maintenance, first measure which folders grow, retain relevant incident and comparison logs, then archive old files under a documented retention policy. Avoid deleting active files during operation or recursively cleaning the whole data folder.

Repeated errors or excessive per-tick logging need a cause-level fix; deleting yesterday’s logs does not stop tomorrow’s growth. Preserve profiles, templates, presets and EA state files. Use the Experts and Journal guide for diagnosis. Detailed backup design belongs to Guide 3.

Plan Windows updates and test startup

Keep Windows security maintenance enabled and arrange a controlled restart window. Check restart scheduling and session policies for the actual Windows edition and provider. Active hours, where available, help manage timing; they are not a guarantee of uninterrupted trading. Do not disable security software or updates to improve a benchmark.

For a startup method that depends on sign-in, create a clearly named shortcut to the intended executable in the intended user’s Startup folder (shell:startup). It runs after that user signs in, not merely because Windows booted. A second startup mechanism can create conflicting launches; document one tested method per intended copy.

If unattended restart is required, have the provider or administrator confirm the supported user-session and launch arrangement. A scheduled task or a running terminal.exe alone is not proof that the correct data folder, account, licensing and EA state are available. Do not configure automatic sign-in with exposed credentials as a quick fix.

On demo, test terminal relaunch and an OS reboot as separate events. After each, verify account/server, profile, charts, EA version and Inputs, permissions, quotes, logs and management of existing orders. Disconnect Remote Desktop and reconnect as another check; signing out or session-timeout policies can end applications. Avoid timed “restart every hour” jobs and blind watchdog relaunches that bypass these checks.

Set useful alerts and check their limits

Choose monitoring that can distinguish resource pressure from loss of terminal or EA operation. Agree who receives alerts and what they check next. Set thresholds from the normal workload, observed peaks and the time available to respond; there is no universal percentage or quote-age threshold.

SignalActionable checkLimit
Sustained CPU / memory pressure or low free storageCompare the affected terminal, background tasks and recent changes with the baseline.A short peak differs from persistent pressure; resource usage alone does not prove trading health.
Missing terminal process or expected heartbeatConfirm the intended instance and its operating context before any relaunch.A heartbeat sent only from OnTick can stop in a quiet or closed market; monitor its documented behavior.
Connection, quote or EA errorInspect the required symbol’s session and latest data, then Experts and Journal.A connected terminal can still have stale required data or failing EA logic.

For push alerts, configure Tools → Options → Notifications, enter the destination MetaQuotes ID and use Test; confirm receipt on the actual device. Standard trade-operation notifications do not cover rejected requests. Where supported, test the EA’s own error alerts on demo too.

A stopped MT4 cannot reliably send its own outage message. An independent process/host monitor or external missing-heartbeat check covers that gap. Prefer a bounded, documented response over a watchdog that repeatedly kills and relaunches a trading terminal.

Use a controlled tuning and acceptance workflow

  1. Record before. Keep the configuration, observation conditions, resource pressure and relevant log timestamps.
  2. Make one justified change on demo. Remove an unused overlay, adjust a documented history limit or separate a tester workload. Keep strategy and risk settings fixed.
  3. Compare like conditions. Reobserve ordinary use, busy quote flow and startup. If conditions differ, record that limitation rather than claiming a measured improvement.
  4. Accept or revert. Retain the change only if required data, EA calculations, permissions and order management remain correct, with enough resource margin. Restore the previous configuration if they do not.
Illustrative decision, not a benchmark. A multi-symbol EA shares a VPS with a tester and an optional dashboard. First move the tester workload away or schedule it outside trading observation, then evaluate the optional dashboard separately. Keep the EA’s required symbols and lookback intact. If pressure persists, investigate the EA with its developer or increase suitable capacity after measurement; do not promise a fixed number of extra EAs.

Repeat acceptance after adding a terminal, changing EA versions, profiles or dependencies, or performing maintenance. A demo restart test confirms an operating procedure; it does not prove identical live fills or future returns.

A repeatable MT4 configuration cycle: map the workload, measure resource pressure, adjust one setting, then verify data, permissions and EA operation before keeping the change.
Keep a resource change only after the intended EA still has its data, permissions and order-management scope. Repeat the checks when the workload changes.

Configuration readiness checklist

Each terminal has a recorded installation path, data folder, Windows user and role
Broker account/server and intended trading access verified
Required charts, symbols, timeframes, history and dependencies retained
EA versions, approved Inputs and ownership of existing orders recorded
Normal use, busy periods and startup observed with capacity headroom
AutoTrading, EA permissions and trusted dependency access verified
Log retention, free storage and Windows maintenance arranged
Terminal relaunch, OS restart, remote disconnect and alerts tested on demo

Keep the date and result of these checks. Review them after meaningful changes and according to the workload’s need for supervision. A configured VPS still needs operating oversight.

Common MT4 configuration questions

How many MT4 terminals can one VPS run?

There is no universal count. Measure all intended terminals, EAs and dependencies during relevant peaks, leaving room for the OS and maintenance. Another installation on the same VPS does not add physical resources.

Should I set the smallest possible bar limits?

No. Keep the data needed by every required symbol, timeframe and indicator. Reduce only confirmed excess, test on demo and preserve the dataset used for comparisons.

Does a green AutoTrading button prove the EA is working?

No. Verify the attached EA’s permission, account access, data, initialization, logs and intended order management. No new trade can be normal when the strategy has no signal.

Should I restart MT4 automatically at a fixed interval?

Not as a substitute for finding persistent load or verifying startup. Plan required maintenance, test the relaunch procedure and use monitoring with a documented response. A blind restart can interrupt management or restore the wrong configuration.

Official references and scope

Platform details were checked against official documentation. The inventory, measurement and acceptance workflow are practical operating guidance, not measured VPS results. Labels can differ with the terminal language or Windows edition; English UI labels here identify the settings to verify.