Step-by-Step Guide

1. Install MetaTrader 5 with Your Preferred Broker
2. Configure and Launch the Trading Algorithm
3. Backtest and Optimize Your Algorithm
4. Set Up a Virtual Private Server (VPS) for 24/7 Trading
1. Install MetaTrader 5 with Your Preferred Broker

(a) Start by choosing a broker with metatrader 5 that fits your trading goals and create your account. You have three main options:

  • Use your own capital with brokers like Admiral Markets.

  • Access monthly capital based on performance through platforms like Darwinex Zero.

  • Earn funded accounts by passing prop firm challenges, where you're given trading capital after proving your skills.

(b) Once your account is created, you can install the MetaTrader 5 platform by following the installation instructions.

(c) Your brokerage account includes login credentials that you’ll use to connect to the MetaTrader 5 platform.

To log in on MetaTrader 5:

  1. Click File (top left corner)

  2. Select Open an Account

  3. Type the name of your broker and select the correct server

  4. Choose Connect with an existing trade account

  5. Enter your login credentials

(d) You're now connected to your functional trading account !

*I highly recommend monitoring your performance with DarwinexZero, especially if you’re new to trading. The cost is affordable and largely refundable if your performance is good. Plus, you can start making monthly payouts once you achieve solid results. Click the icon above if you want to give it a try.

2. Configure and Launch the Trading Algorithm

(a) When you purchase an algorithm from my website, you’ll receive two emails: one with your order receipt, and another with a download link for the algorithm folder. Just click Download to get started.

(b) The folder comes in a compressed .zip format. Open it and extract all the contents into a location that’s easy to find.

(c) If MetaTrader 5 isn’t already open, launch it (it might be named after your broker). In the top-left corner, go to File > Open Data Folder. Once the folder opens, navigate to MQL5 > Experts, and drag the extracted folder into that directory.

(d) On the left side of the MetaTrader 5 platform, you’ll find the Navigator panel. If it’s not visible, go to View > Navigator in the top-left menu to reopen it. Scroll down to the Expert Advisors section — you should see the folder containing your algorithm there.

If it doesn’t appear right away (it usually doesn't), right-click inside the Navigator panel and select Refresh, or simply restart MetaTrader 5.

(e) In rare cases, certain trading algorithms require additional settings to function properly. One example is enabling DLL imports. To do this, go to Tools > Options > Expert Advisors and check the box labeled "Allow DLL imports." Most algorithms will work without this step, but it's good to know just in case.

(f) To have your algorithm running, make sure the Algo Trading button in the platform’s top toolbar is green. This enables your Expert Advisor to run and execute trades.

(g) Finally, to activate your algorithm, drag and drop the Expert Advisor onto the chart you want to trade. In the settings window that appears, go to the Common tab and make sure “Allow Algo Trading” is checked. Once confirmed, your algorithm is officially running.

Note: Your algorithm will continue running only while MetaTrader 5 is open and your computer is on. For uninterrupted, fully automated trading, refer to Section 4: Setting Up a Virtual Private Server (VPS) for 24/7 Trading.

Note: Before proceeding to step (g), ensure you’ve backtested your strategy and optimized your inputs as outlined in Module 3: Backtest and Optimize Your Algorithm. Skipping this step could lead to avoidable losses.

3. Backtest and Optimize Your Algorithm

(a) Depending on the forex pair, index, stock, or cryptocurrency you plan to trade, you’ll need to adjust your inputs accordingly. This section serves as a clear, step-by-step guide on how to use the Strategy Tester in MetaTrader 5—helping you fine-tune the algorithm and uncover an edge in your chosen market.

(b) In the top-left corner, go to View > Strategy Tester. This opens a new section at the bottom of your MetaTrader 5 plateform. Go to Settings.

(c) Watch this video to learn how to optimize your algorithm.

(d) Once you've identified a combination of inputs that yield promising results, it's time to update your algorithm accordingly. To do this, open the MetaQuotes Language Editor by navigating to Tools > MetaQuotes Language Editor in the top-left corner of the MetaTrader platform. From there, you can modify the algorithm's code to reflect your optimized parameters and logic.

Note 1: Beware of Overfitting
When backtesting a trading algorithm, it’s crucial to avoid over-optimizing your parameters. Exceptional performance during backtesting can often result from randomness rather than true predictive power. To mitigate this risk, divide your data into separate periods: use one period for optimizing your inputs (e.g., 2019–2022), and a different, subsequent period (e.g., 2023–2025) for out-of-sample testing. This approach helps ensure your strategy performs well on unseen data and is more likely to generalize in live trading.

Note 2: Factor in Trading Costs
Always account for trading commissions and fees, as they can significantly erode profits—especially with high-frequency strategies. To minimize this impact, favor strategies that limit trading activity. In most cases, one well-chosen trade per day is more than sufficient and often more sustainable than frequent trades.

(e) Click on MQL5 in the Navigator pane, then go to the Experts folder and locate the algorithm you want to modify. Double-click the corresponding .mq5 file to open it in the MetaQuotes Language Editor.

(f) Now manually update the input parameters in the code to match the values identified during your Strategy Tester backtest. After making the changes, press Ctrl + S or click File > Save to save your modifications.

4. Set Up a Virtual Private Server (VPS) for 24/7 Trading

(a) Choose and order your Contabo VPS
Go to contabo.com and select a VPS plan that meets your needs. For most trading strategies, even a basic VPS with 2 vCPUs and 4 GB RAM is sufficient. Choose a data center location near your broker’s server for better latency. Complete the order and wait for your login details via email.

(b) Connect to your VPS via Remote Desktop
Once you receive your VPS credentials, open Remote Desktop Connection on your computer (search for “Remote Desktop” in the Start Menu on Windows). Enter the IP address provided by Contabo, and log in using the username and password from the email.

(c) Install MetaTrader on the VPS
After logging in to your VPS desktop environment, open a web browser inside the VPS and download the MetaTrader 5 (or 4) platform from your broker’s website. Run the installer and complete the installation as usual.

(d) Transfer your trading algorithm to the VPS
To move your .mq5 or .ex5 file to the VPS, you can:

  • Email the file to yourself and download it on the VPS, or

  • Use a cloud service (Google Drive, Dropbox, etc.) and download it there.
    Place the file into the Experts folder via MetaQuotes Language Editor.

(e) Set up your EA and verify it's running
Open MetaTrader on the VPS, go to Navigator > Expert Advisors, drag your algorithm onto the chart, and configure the inputs. Make sure AutoTrading is enabled (top toolbar). Monitor the Journal and Experts tabs for any errors or confirmations that the EA is running.

(f) Keep the VPS running 24/7
Do not close the VPS or log off—just disconnect your Remote Desktop session (click the X). Your EA will continue running in the background as long as the VPS is powered on.