Articles
How to Set Up a Trading Bot on MetaTrader 5 Using IC Markets: A Beginner's Step-by-Step Guide

Trading bots, also known as Expert Advisors (EAs) in MetaTrader 5 (MT5), automate your forex trading strategies by executing trades based on predefined rules. They remove emotional decision-making and can operate 24/7, potentially increasing efficiency. However, trading involves significant risk of loss, and bots do not guarantee profits—always use risk management and start with a demo account. This guide focuses on setting up an EA using MT5 with IC Markets, a popular broker known for low spreads and fast execution.
Prerequisites
Before starting, ensure you have:
- A stable internet connection and a computer (Windows, macOS, or Linux via Wine).
- Basic knowledge of forex trading.
- Funds ready for deposit (minimum $200 for live accounts).

Step 1: Open an Account with IC Markets
IC Markets offers demo and live accounts compatible with MT5. Start with a demo to practice.
- Visit the IC Markets website using this referral link and click "Start Trading" or "Open an Account."
- Fill in your personal details (full name, email, phone) and proceed.
- Select account type (individual, joint, or entity) and provide additional info.
- Choose MT5 as your platform, select account type (e.g., Standard or Raw Spread), and base currency.
- Review details, set a security question, agree to terms, and submit.
- Check your email for a verification link, set a password, and access your client area.
- For live trading, complete verification: Provide employment/financial info, take a knowledge quiz, and upload ID/proof of residence.
- Fund your account via Visa, Mastercard, e-wallets (e.g., PayPal, Skrill), or wire transfer (minimum $200).
Once verified, you'll receive your login ID, password, and server details.

Log in to your IC Markets client area.
- Navigate to the "Platforms" section and download the MT5 installer for your OS (Windows/Mac).
- Run the installer, follow the prompts, and complete setup. Launch MT5.

Step 3: Log In to MT5 with Your IC Markets Account
Use the desktop version for full EA functionality (mobile is limited).
- Open MT5.
- Go to File > Open an Account (or Login to Trade Account).
- Search for "ICMarketsAU" (or your region, e.g., ICMarketsSC for global) and select the live server (e.g., ICMarketsAU-Live).
- Choose "Login to an existing account."
- Enter your Login ID, Password, and select the server.
- Click "Finish." You'll be prompted to change your password on first login—follow the steps.
Your account balance and charts will load. Switch to demo if practicing.

Step 4: Obtain an Expert Advisor (EA)
EAs are .ex5 files containing your bot's code.
- Download free/paid EAs from the MT5 Market (inside MT5: Tools > Market) or trusted sources like MQL5.com.
- For custom bots, use MQL5 language in MetaEditor (built into MT5).
- Avoid unverified EAs to prevent scams or malware.
Save the .ex5 file to your computer.

Step 5: Install the EA in MT5
In MT5, go to File > Open Data Folder.
- Navigate to MQL5 > Experts.
- Copy the .ex5 file into this folder.
- Restart MT5 or right-click Expert Advisors in the Navigator panel (Ctrl+N to open) and select Refresh.
- The EA should appear under Expert Advisors in Navigator.

Step 6: Attach the EA to a Chart and Configure It
Open a chart for your desired pair (e.g., EUR/USD) via Market Watch (Ctrl+M).
- Drag the EA from Navigator onto the chart, or right-click it and select Attach to Chart.
- In the settings window:
- Inputs tab: Adjust parameters like lot size, stop-loss, take-profit.
- Common tab: Enable "Allow live trading" and set optimization if needed.
- Click OK. A smiling face icon in the chart's top-right confirms attachment.

Step 7: Enable Auto Trading
Click the AutoTrading button in the toolbar (it turns green when active).
- Go to Tools > Options > Expert Advisors and check "Allow automated trading" and "Allow DLL imports" (if required by the EA).
- Monitor the Experts tab in the Terminal (Ctrl+T) for logs—no errors means it's running.
Step 8: Test the EA Before Going Live
Always test to avoid losses.
Backtesting
- Go to View > Strategy Tester (Ctrl+R).
- Select your EA, symbol, timeframe, and date range.
- Choose "Every tick" for accuracy, set initial deposit, and click Start.
- Review results: Profit factor, drawdown, trades. Optimize parameters if needed.
Forward Testing
Run on a demo account for 1-2 weeks under live conditions to check real-market performance.

Step 9: Deploy on a Live Account
Once satisfied:
- Switch to your live account in MT5.
- Attach and enable the EA as in Steps 6-7.
- Start with small lot sizes (e.g., 0.01) and monitor closely.
- Use a VPS for 24/7 operation to avoid interruptions.

Step 10: Setting Up a VPS for 24/7 Trading
A Virtual Private Server (VPS) is essential for running your MT5 bot uninterrupted, even when your home PC is off. It provides low-latency connections (under 1ms to broker servers), high uptime (99.99%), and remote access via RDP. Choose a VPS near IC Markets' Equinix NY4 data center for minimal delays.

IC Markets Free VPS
Qualifying IC Markets clients can get a free VPS with ultra-low latency and pre-configured for MT5. Requirements include a minimum monthly trading volume of 10 lots (Standard account) or 5 lots (Raw Spread), plus a $200 deposit for trial access. Sign up via your client area or this page.
Recommended Third-Party VPS Providers
If you don't meet IC Markets' criteria, consider these top-rated options optimized for forex bots:
- ForexVPS.net: Forex-specific hosting with MT5 pre-installed, 100% uptime guarantee, and plans starting at $28/month. Ideal for automated strategies. Visit ForexVPS.net
- Trading FX VPS: Low-latency servers in major hubs, MT5 support, and pricing from $25/month with 99.99% uptime. Visit Trading FX VPS
- Kamatera: Flexible cloud VPS with global data centers, scalable resources, and affordable entry at $4/month—great for beginners testing bots. Visit Kamatera
To set up: After signup, connect via Remote Desktop, download/install MT5, log in with your IC Markets details, and deploy your EA. Test on the VPS demo first.
Tips and Warnings
- Risk Management: Never risk more than 1-2% per trade. Use stop-losses.
- Monitoring: Check the Journal/Experts tabs daily for issues, and review VPS performance metrics.
- Costs: IC Markets charges spreads/commissions; factor them into tests. VPS adds $20-50/month unless free.
- Regulations: Ensure compliance with your region's rules.
- Trading bots can amplify losses in volatile markets—educate yourself and consider professional advice.

By following these steps, you'll have a trading bot up and running on MT5 with IC Markets. Start small, learn continuously, and trade responsibly! If you encounter issues, refer to IC Markets support or MT5 help.