MQL5 Cloud Network: Run Backtests Faster in the Cloud

Set up the MQL5 Cloud Network for MT5 backtesting and optimization. Learn costs, agent management, and best practices to speed up your Strategy Tester runs.

mql5-cloud-network-run-backtests-faster-in-the

Why Your Local Backtests Are Slowing You Down

If you've ever watched the Strategy Tester crawl through a three-year optimization with 10,000 passes, you know the pain. A single run can take hours on your local machine, and during that time you can't really use MetaTrader 5 for anything else without slowing the test further. The MQL5 Cloud Network solves this by distributing those passes across a pool of remote computers, all running the same MetaTrader 5 tester engine. You pay a small fee per completed pass, and the whole optimization finishes in a fraction of the time.

This guide walks you through the entire process: what you need before you start, how to enable cloud agents in the Strategy Tester, how credits work, and how to avoid the common mistakes that waste both time and money. You'll also get practical tips on when the cloud is worth it and when it's not.

What Is the MQL5 Cloud Network?

The MQL5 Cloud Network is a distributed computing service built into MetaTrader 5. When you run a backtest or optimization, the tester can offload individual passes to remote agents — computers owned by other users who have opted to share their processing power in exchange for MQL5 credits. Your own machine can also become a remote agent when idle, earning credits that offset your own cloud costs.

It's not a separate application. Everything is controlled from the Strategy Tester window in the MT5 terminal, and the cloud agents appear in the Agents tab just like your local ones. The key difference is that cloud agents are external, and you pay for their use.

Prerequisites: What You Need Before Starting

Before you dive into cloud testing, make sure you have the following:

  • MetaTrader 5 build 2000 or newer — the cloud network integration has been refined over several builds. An outdated terminal may not show all available options. Check via Help → About.
  • A live trading account — you don't need a funded account, but you need a real account login. Demo accounts can't purchase credits or use the cloud network.
  • MQL5 credits — these are purchased from the MQL5 website (www.mql5.com) or directly from the terminal via Tools → Global Variables? No, that's wrong. You buy credits from your profile page on mql5.com, under Balance → Buy credits. You can also top up from the Market tab or the Signals section — anywhere you see your account balance.
  • A compiled EA or script — the code must compile without errors in MetaEditor. Cloud agents run the same tester engine, but if your code uses external DLLs or file operations that aren't allowed in the cloud, the test will fail.

One thing most traders overlook: the cloud network only works with MetaTrader 5. MT4 has no equivalent service. If you're still on MT4, you're stuck with local agents.

Step-by-Step: Enabling and Using the Cloud Network

Step 1: Verify Your Account and Credits

Log into your MT5 terminal with a live account. Open the Toolbox (Ctrl+T) and check the Account History tab — you should see your real account number. Now go to mql5.com in your browser, log in, and check your Balance under your profile. If you have zero credits, buy a small package to start — the minimum is usually around $10 worth, though pricing varies. You don't need a fortune; a few dollars covers a lot of single backtests.

Step 2: Open the Strategy Tester and Select Your Settings

In the MT5 terminal, open the Strategy Tester (Ctrl+R). Set up your test as you normally would:

  1. Choose your EA from the dropdown.
  2. Pick the symbol and timeframe.
  3. Set the model — for cloud testing, "Every tick based on real ticks" is the most accurate but also the most expensive. "1 minute OHLC" is a good middle ground.
  4. Enter your date range.

Don't start the test yet. First, you need to configure the agents.

Step 3: Configure the Agents Tab

Click the Agents tab at the bottom of the Strategy Tester window. You'll see a list of local agents (usually "Local" with a number). To add cloud agents, look for the MQL5 Cloud Network section — it's typically a button or checkbox labeled "Use the MQL5 Cloud Network" or similar, depending on your build.

Click it, and you'll see a dialog asking how many cloud agents you want. You can select from 1 up to the maximum available (often 64 or more, depending on network capacity). The dialog also shows the cost per agent per 1,000 passes — this is your budget control.

A critical setting here is the maximum number of agents and the cost limit. I always set a hard cap on credits per run. If an optimization blows past your budget, you don't want it running up a bill overnight. Look for the field labeled "Maximum cost" or "Limit credits" and set it to a number you're comfortable with.

Step 4: Run the Test

Now click Start. The tester will first run a short "pre-test" locally to validate your EA and settings. If that passes, it sends the job to the cloud network. You'll see the cloud agents appear in the Agents tab as they pick up work, each showing its progress and current pass number.

During a single backtest (not optimization), the cloud splits the time series into segments and each agent processes a chunk. For optimizations, each pass is a separate job, so the speedup is more dramatic — 100 agents can chew through 10,000 passes in minutes.

Step 5: Monitor Progress and Costs

While the test runs, keep an eye on the Job tab in the Strategy Tester. It shows the status of each pass, including whether it was completed, failed, or skipped. The Results tab updates live, so you can watch the optimization graph fill in. Your credit balance on mql5.com decreases in real time; you can also see the estimated cost in the tester's Settings tab before you start.

How Much Does the Cloud Cost?

Pricing is per agent per 1,000 passes, and it varies based on the testing model and the complexity of the job. As a rough guide, "Every tick" is roughly 5–10 times more expensive than "1 minute OHLC." The exact rate is shown in the cloud network dialog before you start, so there are no surprises if you check it.

Here's a realistic example. A 5-year optimization on EURUSD with 5,000 passes using "1 minute OHLC" might cost around 20–30 credits. At current rates, that's a couple of dollars. The same run with "every tick" could cost $10–15. For a single backtest, the cost is much lower — often a fraction of a credit.

You can earn credits by becoming a provider. If you leave your MT5 running with the "Allow the use of MQL5 Cloud Network agents" option enabled (found in Tools → Options → Expert Advisors), your CPU cycles get sold to other users when you're idle. This is a passive way to fund your own testing, but it only works when you're not running local tests.

Tips and Best Practices from Experience

After running hundreds of cloud tests, here's what I've learned that isn't in the official docs:

  • Start small. Run a 100-pass optimization locally first to make sure your EA doesn't crash or produce nonsense results. A bug that causes a runtime error on pass 47 will waste cloud credits on 46 passes before it fails.
  • Use the "1 minute OHLC" model for broad sweeps. When you're exploring a parameter space, you don't need tick-perfect accuracy. Find the promising regions with the cheaper model, then drill down with "every tick" on a smaller range.
  • Cap your credits per run. I always set the maximum cost to 50% above my estimate. If the optimization takes longer than expected, the cap stops the bleeding.
  • Close other MT5 charts. The cloud agents use your terminal's resources for the pre-test and for aggregating results. If you have 10 charts with heavy indicators running, it slows down the orchestration, even if the heavy lifting is remote.
  • Check the "Skip" rates. In the Job tab, if a large percentage of passes are skipped (marked with a gray icon), your parameter ranges are producing invalid inputs. Fix the EA logic before spending more credits.
  • Time your runs. The cloud network has peak hours. Runs started during European or US trading hours can have longer queue times. If you're in a hurry, try early morning UTC.

Common Mistakes and Troubleshooting

Mistake 1: Not Compiling in 64-bit Mode

Cloud agents run 64-bit builds of the tester. If your EA was compiled as 32-bit (the default in some older MetaEditor versions), it will fail on cloud agents. Fix this in MetaEditor → Tools → Options → Compiler — check the box for "Build 64-bit" (or "x64"). Then recompile and run a local test to confirm it works.

Mistake 2: Using Forbidden Functions

The cloud network has strict security restrictions. Functions like FileOpen(), FileWrite(), TerminalInfoString() calls that return local paths, and any use of DLL calls are blocked. If your EA uses any of these, the test will fail immediately with an "unsupported operation" error. Check your code for these calls before you spend credits. A quick search in MetaEditor (Ctrl+F) for "File" or "DLL" will reveal most issues.

Mistake 3: Ignoring the "No Trading" Flag

Some EAs use MQLInfoInteger(MQL_TRADE_MODE) to check if trading is allowed. In cloud tests, the trade mode is always TRADE_MODE_NONE — the tester doesn't actually send orders. If your EA refuses to run without a live trading context, it will exit early on cloud agents. You can work around this by checking the MQL_TESTER flag and overriding the trade mode check during tests.

Mistake 4: Running Out of Credits Mid-Optimization

If your balance hits zero, the test stops, and you lose all the completed passes — you don't get partial results. Always check your balance before starting a big run, and set the cost cap lower than your total balance. There's no warning before you run out, so be conservative.

Troubleshooting: Cloud Agents Not Appearing

If you've enabled the cloud network but no agents show up, check the following:

  • Your terminal is connected to the internet and logged into your MQL5 account.
  • You have a positive credit balance.
  • Your build is up to date. Older builds may not support the cloud network.
  • Your firewall isn't blocking port 443 (HTTPS). The cloud uses standard web sockets, but some corporate firewalls block them.

If all that checks out, try restarting the terminal and re-enabling the cloud option. It's a known quirk that the checkbox sometimes doesn't register until a restart.

When the Cloud Is (and Isn't) Worth It

Be honest with yourself about your needs. The cloud shines for optimization — sweeping a large parameter space with thousands of passes. It's also great for multi-symbol backtests that take hours locally.

But for a single backtest on one symbol with a short date range, the cloud is overkill. The pre-test and job distribution overhead can make it slower than just running locally. I only use the cloud for runs that would take more than 15–20 minutes on my machine. Below that, local agents are faster and free.

There's also a subtle accuracy consideration. Cloud agents process the same tick data, so results are identical to local runs — there's no variance. But the model you choose has a huge impact. If you use "1 minute OHLC" in the cloud to save money, you're accepting the same loss of precision you'd get locally. The cloud doesn't magically make a coarse model accurate.

Summary and Next Steps

The MQL5 Cloud Network is the fastest way to run large optimizations in MetaTrader 5. You've learned how to verify your account, purchase credits, enable cloud agents in the Strategy Tester, and monitor costs. You also know the common pitfalls — 64-bit compilation, forbidden functions, and credit caps — and how to avoid them.

Your next step is practical: compile your EA in 64-bit mode, run a small 100-pass optimization locally to verify stability, then set up a cloud run with a modest credit cap. Start with the "1 minute OHLC" model to keep costs low while you get comfortable with the workflow. Once you see how fast 50 agents chew through 5,000 passes, you'll wonder why you ever waited on local hardware.

If you want to offset costs, enable the "Allow the use of MQL5 Cloud Network agents" option in Tools → Options → Expert Advisors and let your machine earn credits while you sleep. It's not going to make you rich, but it'll fund a few free optimizations a month.

Frequently Asked Questions

How much does the MQL5 Cloud Network cost per backtest?

Pricing is per agent per 1,000 passes, shown in the tester before you start. A typical 5,000-pass optimization on 1-minute OHLC costs roughly 20–30 credits (a few dollars). "Every tick" is 5–10x more expensive. Single backtests cost a fraction of a credit.

Can I use the MQL5 Cloud Network with MetaTrader 4?

No. The cloud network is exclusive to MetaTrader 5. MT4 has no equivalent distributed testing service, so you're limited to local agents.

Why do my cloud tests fail with "unsupported operation" errors?

Your EA likely uses a forbidden function like FileOpen(), FileWrite(), or a DLL call. Cloud agents block these for security. Search your code for "File" and "DLL" in MetaEditor, remove or bypass those calls, and recompile in 64-bit mode.

How do I earn free MQL5 credits for cloud testing?

Go to Tools → Options → Expert Advisors in MT5 and enable "Allow the use of MQL5 Cloud Network agents." When your terminal is idle, your CPU is rented to other users and you earn credits. It's passive but modest — enough to offset occasional testing.

Community

Clap for the article and open comments only when you want to read them.

0 claps0 comments

Related articles