Technical Guide for MT5 Backtesting

MT5 Optimization: When RAM Becomes the Main Bottleneck

More CPU cores do not help much when Strategy Tester agents are waiting for memory, paging to disk, or competing for the same RAM pool.

This usually happens when you increase symbols, time ranges, agent count, or optimization depth faster than available memory grows. The result is slower passes, less predictable timing, and a server that looks busy without finishing work efficiently.

Quick answer: MT5 optimization becomes RAM-bound when the combined memory demand of local or remote agents, historical data, caches, Windows overhead, and logs exceeds real available RAM, which pushes the workload into paging and makes CPU scaling fall apart.

MT5 Strategy Tester Remote agents Dedicated CPU and RAM Windows Server with RDP
What changes first

Optimization throughput often stops improving before CPU usage reaches a clean, stable ceiling because memory contention starts to dominate.

What traders usually miss

Adding more agents without enough RAM can make the run slower, not faster, especially when multiple symbols and long history ranges are loaded at once.

Typical next step

Move from a light MetaTrader VPS to a dedicated server for MetaTrader, or distribute the load with an EPYC backtest farm.

Why This Happens

MT5 optimization can shift from CPU-bound to memory-bound very quickly

A small live trading setup may fit comfortably on a normal Windows VPS for MetaTrader, but optimization is a different workload. Once Strategy Tester begins loading more history, more symbol combinations, and more concurrent agents, RAM becomes a hard capacity limit. That is one reason serious research setups often grow into a dedicated MetaTrader server or an MT5 backtest farm.

What consumes memory during optimization

  • Each Strategy Tester agent needs working memory for the current pass.
  • Historical data, symbol data, and tester caches stay resident for reuse.
  • Windows Server itself needs overhead for the OS, services, and RDP session.
  • Logs, reports, and temporary files add pressure when many passes run together.

What happens when memory runs short

  • Windows starts paging and NVMe activity rises without a proportional speed gain.
  • Agent count stops scaling linearly even if the CPU still has theoretical headroom.
  • Optimization passes finish less predictably and queues stretch out.
  • Live terminals on the same machine can become less responsive.

Decision Table

Use this table to judge whether RAM is the real blocker

The goal is not to guess an exact gigabyte number in isolation. The useful question is whether the machine still has enough memory per agent and enough spare headroom for the full test shape.

Situation What you usually see Likely bottleneck Practical next step
1 to 2 terminals, light checks, short test windows Stable desktop, low agent count, limited memory growth Usually not RAM yet Start with a trading VPS and leave some spare memory.
Several concurrent agents, deeper history, more symbols CPU does not scale cleanly as agent count increases RAM pressure or mixed CPU plus RAM load Move to a dedicated server with reserved CPU and RAM.
Heavy genetic optimization or many remote agents Paging, unstable timings, long queues, desktop lag RAM is often the main bottleneck Reduce agent density or split the work across an EPYC backtest farm.
Live trading and optimization on one machine Tests interfere with terminal responsiveness Resource contention, often memory first Separate live trading from test infrastructure, especially for POW EA VPS or other always-on systems.

Practical Setup

A practical setup sequence for RAM-sensitive MT5 optimization

Keep the workflow simple. First isolate the workload, then scale agent count only when memory remains stable.

1

Separate live and test roles

Keep production terminals on their own VPS or dedicated environment so heavy testing does not affect active trading.

2

Measure one realistic run first

Use the same symbols, timeframes, data depth, and optimization mode you actually care about, then observe memory use before scaling out.

3

Add agents gradually

Increase concurrency step by step. If throughput stops improving while paging or desktop lag appears, memory is already close to the limit.

4

Leave working headroom

Do not size the server for a perfectly full RAM graph. Leave capacity for Windows, logs, updates, and cache growth across longer runs.

5

Scale out when one box stops being clean

If a single machine becomes cramped, add remote agents and keep your local MT5 terminal as the master node.

6

Use NVMe as support, not a substitute

Fast storage helps with history files and temporary data, but it does not replace enough RAM once the workload is memory-bound.

Checklist

RAM bottleneck checklist for MT5 Strategy Tester

If several of these points are true at the same time, the optimization setup usually needs more memory, fewer concurrent agents, or a different server class.

Before you scale agent count

  • Check whether live trading terminals are sharing the same machine.
  • Confirm how many symbols and how much history the test is loading.
  • Make sure the agent count matches the actual workload, not only the CPU thread count.
  • Reserve headroom for Windows, RDP, and background services.

Warning signs during the run

  • Optimization speed does not improve after adding more agents.
  • Disk activity climbs because the system is paging.
  • Agent timing becomes inconsistent from pass to pass.
  • The desktop or terminal becomes slow even though the server seems fully provisioned.

Troubleshooting

What to change before you buy a bigger machine

Upgrading is often the right move, but first remove the obvious mistakes that make MT5 optimization waste memory.

Reduce avoidable memory pressure

  • Lower the number of concurrent agents and compare throughput, not only CPU usage.
  • Split long studies into batches by symbol or date range.
  • Keep unused terminals, charts, and indicators closed during heavy tests.
  • Do not combine live trading, optimization, and unrelated tools on the same Windows session.

Fix architecture, not only symptoms

  • If one machine is full, move to reserved resources instead of squeezing a shared VPS harder.
  • If the test is parallel by nature, distribute agents instead of overloading a single host.
  • If your main issue is heavy MT5 research, choose infrastructure built for that exact use case.
  • If you also run always-on automation, keep it isolated from the test environment.

When VPS Is Not Enough

When a VPS stops being the right tool

A VPS is still a good starting point for lighter MetaTrader work, but the upgrade path matters. The wrong choice is often not a weak server by itself. It is using the same class of server after the workload has already changed.

Light Workload

Stay on VPS

Good for a small number of terminals, lighter checks, and 24/5 or 24/7 trading where you mainly need Windows, RDP access, and stable uptime.

  • 1 to a few terminals
  • Limited Strategy Tester usage
  • Low to moderate RAM growth
View VPS options
Single Heavy Node

Move to Dedicated

Best when you need reserved CPU and RAM for heavier MT5 optimization, many terminals, or a cleaner environment for trading infrastructure.

  • No noisy neighbours
  • More predictable scaling
  • Better separation of roles
View dedicated servers
Parallel Research

Use Backtest Farm

Best when one machine is no longer clean enough and you need many remote agents for large optimization batches while keeping your own MT5 terminal as the controller.

  • Many concurrent agents
  • Large optimization volume
  • Scale-out instead of overload
Explore EPYC farm

FAQ

Frequently asked questions

How do I know RAM is the main MT5 optimization bottleneck?

RAM is usually the main bottleneck when MT5 optimization slows down as you add more local or remote agents, Windows starts paging to disk, and CPU usage stops scaling cleanly because agents are waiting for memory instead of actively computing.

Does adding more CPU cores help if MT5 is already short on RAM?

Not much. Extra CPU helps only when each agent still has enough memory. If RAM is exhausted, more cores can leave you with more waiting agents, heavier paging, and less predictable optimization times.

How much RAM should I plan for MT5 Strategy Tester?

There is no single fixed number because memory use depends on symbols, timeframes, historical depth, optimization mode, and how many agents run in parallel. In practice, you should size RAM for the full workload, not only for one terminal, and leave headroom for Windows, logs, and cached test data.

When is a VPS no longer enough for MT5 optimization?

A VPS is usually no longer enough when you need many concurrent agents, stable reserved resources, or separation between live trading and heavy testing. At that point, a dedicated server or an EPYC backtest farm is a better fit.

Need help sizing MT5 infrastructure?

Tell us how many terminals, agents, symbols, and test windows you run. We can help you choose between a VPS, a dedicated server, or a larger remote-agent setup without pretending that one box fits every workload.

Discuss Your Setup
Messenger trigger opens WhatsApp or Telegram support.
K.S.M. Trade Sp. z.o.o. | NIP/VAT PL5273128546 | REGON 52957272900000 | Adress: ALEJA JANA PAWLA II 27 WARSAW, POLAND 00-867
## Meta Pixel / CAPI tracking (WS_BILLING_ATTRIBUTION_V7 — since 2026-08-10) **Superseded the old per-page inline block.** All tracking logic (Pixel init, attribution handoff, click tracking, the CAPI beacon) now lives in one stable file: `/var/www/fastpanel-sites/winservers.net/assets/ws-tracking.js`, loaded via a single `` tag. Do **not** re-inline the old Meta Pixel block into new pages — this was the root cause of the old setup silently losing tracking: static pages get regenerated (by Joomla previously, or by whatever generates a page now) and any inline-injected script is wiped, while a stable referenced file survives. ### Why this changed `winservers.net` is pure static HTML — the nginx vhost has no PHP handler at all (`index index.html;`, no `fastcgi_pass`). An audit on 2026-08-10 found the old inline-JS approach had decayed: the attribution marker was present on only 14 of 215+ pages with the Pixel, and several primary ad-landing pages (`/vps/`, `/order/`, some FAQ pages) had **no tracking code at all**. The billing-side ad reconciliation data (`ADS.md`, "Source data and measurement limits") independently confirmed the symptom: only 1 of 3 known advertising-driven orders had a matching Meta `Purchase` event. ### Architecture ``` Visitor clicks a Meta ad -> fbclid/utm_* in the URL on winservers.net -> nginx captures them into first-party cookies on EVERY request (fastpanel-migration.conf, WS_BILLING_ATTRIBUTION_NGINX map blocks — server-layer, independent of page content, survives any regeneration) -> ws-tracking.js reads those cookies: - fires PageView both via the browser Pixel (sets _fbp) and via a server-side beacon, deduplicated with a shared eventID - on click to billing.winservers.net: appends the cookie values to the outgoing URL as query params, and beacons CheckoutIntent_Click / GoToBilling_Click -> POST https://billing.winservers.net/api/site-events/track (public, unauthenticated, rate-limited 30/min/IP, closed event_name allowlist) forwards to MetaConversionsApiService — the same queued-delivery/retry/logging pipeline used for every billing-side event -> billing.winservers.net: CaptureMetaAttribution middleware reads the fbclid/utm_* query params on arrival, stores them, and later CompleteRegistration / InitiateCheckout / Purchase events use them ``` ### Rules (unchanged from before) - `InitiateCheckout` and `Purchase` must **not** be sent by browser JS. They are server-side-only events on `billing.winservers.net`, fired after a real order/bill exists (see `META_CONVERSIONS.md` on the billing server). - `CheckoutIntent_Click`: a link to `billing.winservers.net` whose URL contains `/cabinet/new-order` or `do=tarifs`, or whose visible text contains `order`, `choose`, `select`, `tariff`, `plan`, or `checkout`. Order-intent, not a created order. - `GoToBilling_Click`: every other link to `billing.winservers.net` (SIGN-IN, My account, etc.). Do not mix with order-intent clicks. - To tag a non-link element explicitly (e.g. the AI chat CTA), add `data-ws-event="Lead"` — no separate handler needed, `ws-tracking.js` already listens for `[data-ws-event]` via its delegated click listener. ### New pages Just add the one `` tag before ``. Nothing else is required — attribution capture (nginx) and the click handler (delegated on `document`) both apply automatically, site-wide. `/root/winserversnet/scripts/ws_tracking_migrate.py` did the one-time bulk migration from the old inline block (idempotent — safe to re-run on any file; prints `ALREADY` if a page already references `ws-tracking.js`). --- ## Бургер-меню на мобайле — обязательно на каждой новой странице На всех статических лендингах навигация должна сворачиваться в бургер на мобайле. Реализовано на: `/vps/`, `/vps-for-ea/`, `/mt5-optimization-server/`, `/dedicated-server-metatrader/`, `/mt5-backtest-farm/`. ### CSS — добавить один раз в `