Abstract: This article provides the steps to follow in installing a forex trading robot on your MT5 trading portal. The MT5 desktop portal is the version of the MT5 on which a forex trading bot can be installed.
This article provides the steps to follow in installing a forex trading robot on your MT5 trading portal. The MT5 desktop portal is the version of the MT5 on which a forex trading bot can be installed.
There is not much of a difference between installing a robot for the MT5 platform and its predecessor, the MT4. However, there is also the option of using a Forex robot on an MT5 setup on a remote network connection. Therefore, we will also cover this installation and the traditional setup on the desktop/laptop portals.
A forex trading robot, also known as an Expert Advisor (EA), is a software program created to automatically generate trades on a forex trading platform according to a pre-designed strategy. In other words, a trading robot automates a trading strategy built to work on a trading platform. Various algorithms and statistical/mathematical models are used to create these strategies. The end goal is to analyze and interpret market criteria to execute trades on a traders behalf.
Trading robots can be semi-automatic or fully automatic. They generate entries, exit points, trade sizes, and various order types. An earlier article on this site identified that the trading strategies used to create trading robots are based on rules derived from various criteria, such as statistical models, economic data (news events), price action, and market microstructure.
An essential component of using forex trading robots is the ability to install them on forex trading software and trading platforms such as Metatrader and get them working on virtual private servers so they can trade almost nonstop without the interference of human emotions. The best forex robots are those that have been tested and optimized to trade the forex markets profitably.
Installing a forex trading robot on the MT5 involves loading the robots files into the MQL5 software folder and activating it on the platform so that you can use it to trade your preferred assets.
You may then trade on your local computer, or you may link your local computer to a Forex Virtual Private Server and enable your trading bot for 24/7 trading.
If you would rather learn how to install your forex trading robot on an MT4, heres the guide for you:
How to Install Forex Trading Robot in MT4
The MT5 platform has a browser-based version, a mobile app for Android users, and a desktop client. You can only install a forex trading robot on the desktop client. The process is easy and can be completed in a few steps.
If you own a forex trading robot coded using MQL4, it will not work on the MT5 platform. You must re-code the robot‘s parameters using the MQL5 programming language, C#. This will ensure your trading bot’s executable file is in the .mq5 or .ex5 file format. Once you have this in place, the installation proper can commence.
Ensure that your MT5 desktop client is open. You can use the data folder to install the Forex bots file by clicking on File -> Open Data Folder -> MQL5 -> Experts. This action opens the subfolder on which to store the .mq5.
Copy and paste your trading robots .mq5 EA system file into the Experts subfolder.
Newer MT5 trading platforms do not require you to restart your MT5 client or refresh the navigator tab. The EA can be used immediately after installing it into the MQL5 Experts subfolder.
If your MT5 is an older version of the Metatrader platform, you can restart your MT5 desktop client or right-click on the Expert Advisors tab in the Navigator window, then click on Refresh in the dropdown menu that appears. The EAs name will show under this tab, allowing you to deploy your automated trading robot on your preferred asset.
Click “Auto-Trading” or “Algo Trading” at the top of the screen to enable the EA to go live. A smiling face at the top-right corner of the chart indicates that the forex robot is active.
The previous route describes installing your trading robot on the MT5 desktop client. You can take this installation further by ensuring you connect the setup to a Forex virtual private server.
Using a Forex VPS ensures that you can use your Forex robots to trade around the clock, ensuring you have no downtime and do not miss any opportunities.
To install the MetaTrader 5 (MT5) trading platform on a forex VPS, follow the steps below:
Pick a suitable VPS provider: There are many VPS providers out there, but it is advisable to pick one whose servers and associated infrastructure are designed specifically for the needs of the forex market. ForexVPS has a service that meets the needs of forex traders in terms of virtualization, price, and performance. Colocation to the trading hubs where the liquidity providers are located is another primary consideration.
Configure the VPS by setting up the servers virtual machine. Typically, when paying for your Forex VPS, you will be offered various plans and packages and given instructions on performing functions such as allocating system resources and other network configurations.
A good VPS provider will provide compatible payment systems for easy subscriptions for allocated packages. Some provide the use of VPS packages free for live account holders, while for others, a deduction can be made from the traders live account on MT4 or MT5 to cover the cost of the service.
There are two ways of testing your forex trading robot on MT5: backtests and forward tests.
Backtest
You can test the performance of your best forex robots in the financial markets and use this process to debug your trading robots. A backtest is simply a simulation of the performance of the forex trading robot using historical price data. The process involves harvesting price data dating back several years, cleaning up this data, and feeding it to the MT5 Strategy Tester to see how the robots encoded strategy would have performed in those market conditions.
How do you backtest a forex trading robot? Backtests can be done with the following tools:
Trading platforms like MetaTrader possess an inbuilt Strategy Tester, which allows the trader to import historical data and use these to backtest and optimize the trading robot. However, the challenge here is usually getting a source of clean 1-minute data that can be used for this process.
Third-party software: Third-party strategy testing software is also available. These can be used to provide backtesting and optimization for your trading robots.
Backtests are not always an accurate method of testing a Forex robot‘s performance on the MT5. Market conditions tend to evolve, and the forex market has evolved quite dramatically in the last few years, especially after the onset of the COVID-19 pandemic. Using data that precedes this time may present a skewed outlook on your robot’s potential performance. For this reason, some traders prefer to use the forward test.
Forward Test
Forward testing does not rely on historical market data to test the performance of a forex trading robot or the strategy used to create it. Instead, forward testing uses current market data, usually in the live trading environment, to assess a robot‘s performance. Forward testing is considered more reliable than backtesting because it gauges the robot’s performance using the same conditions it will face when being used for trading real money. A forward test uses the current state of the markets volatility, something that cannot be achieved with a backtest.
Forward testing can be done using a demo account or a live account. However, it is advocated that a robot be forward-tested using a small live account. That way, you risk very little money and still get a taste of the real money trading conditions that the trader will eventually face with a live account.
Whatever testing pathway the trader chooses for a forex robot, it is crucial to constantly tweak and optimize the robots performance to match the constantly evolving market conditions.
Why would a forex trading robot fail to work? Here are possible reasons:
Improperly written code, especially within the init section of the code. Note that the init section is where the sequence to initiate the robots action is written.
Improper settings on the platform. One example is not installing the .mq5 or .exe5 robot file in the proper folder.
Not activating the forex robot after installation. You must attach the robot to a chart of the asset you want to trade and click the Auto Trading/Algo Trading button to activate it. If the face on the top-right corner of the chart is frowning, it is a sign that the robot is not active.
You also have to set the robots parameters properly. Some traders may decide to set it to trade short positions only or long positions only. There is also a setting to enable the forex trading robot to trade both long and short positions. Has the right trade entry setting been used?
These reasons automatically lead to solutions for each problem. If the code has not been appropriately written (usually found out on backtesting), the programmer has to go back to debug and clean up the code.
The smallest device that can run MetaTrader 5 (MT5) and support an Expert Advisor (EA) is generally a smartphone or tablet with mobile MT5, though with some limitations. Heres a look at options for running MT5 and EAs on compact devices:
MT5 Mobile App: You can use the MT5 app on iOS or Android devices, which supports basic trading, charting, and indicators.
Limitations: The mobile app does not natively support the running of EAs, as EAs require the desktop version of MT5. However, you can monitor trades opened by an EA on the desktop and manage them on mobile, but the EA itself must be deployed and running on a desktop or VPS.
Devices like the Microsoft Surface Go, ASUS VivoBook E203MA, or Chromebooks that support Windows or Linux (with Wine to run MT5) are small, lightweight, and portable, capable of running MT5 and EAs. Chromebooks running Linux apps can use the MT5 desktop platform with some modifications, but a Windows-based device is generally more reliable.
Specs: Ideally, 4GB of RAM and an Intel Celeron processor or better is recommended. This setup is sufficient for lightweight EAs and basic trading but may struggle with resource-intensive EAs.
Raspberry Pi 4 with 4GB or 8GB of RAM can run MT5 through an emulator like Wine on a Linux-based OS (e.g., Raspberry Pi OS). This setup can technically support MT5 EAs, but performance is limited, and setup can be challenging.
Limitations: Raspberry Pi hardware is not optimized for MT5 or Windows applications, so performance will be lower than on traditional desktop hardware. However, it can handle simpler EAs and is an affordable, ultra-compact option for experimentation.
For a truly mobile setup with full EA functionality, many traders use a VPS to host MT5 and access it via remote desktop from their phone, tablet, or lightweight laptop.
Benefits: This allows you to run complex EAs 24/7 without needing a high-powered local device. Any device with a Remote Desktop Protocol (RDP) client can access the VPS, which is where MT5 and the EA run.
Device Type | EA Support | Portability | Performance |
Smartphone/Tablet | Monitor only (EA runs elsewhere) | Very portable | Limited |
Compact Laptop/Mini PC | Full EA support (Windows/Linux) | Portable | Moderate |
Raspberry Pi | Limited EA support (Linux + Wine) | Very compact | Low |
VPS (accessed from mobile) | Full EA support on VPS | Very portable | High (depends on VPS specs) |