Learn How To Use Trading Robots.
From Zero To Advanced.
The world's most comprehensive library for understanding, installing, configuring, testing, and operating trading robots and automated trading technology. Clear, practical, professional education.
Learning Paths
Four structured levels. Start where you are. Progress at your own pace.
Complete Beginner
"I have never used a robot." — Start with the absolute fundamentals.
Getting Started
"I want to install and run my first robot." — Practical, step-by-step setup.
Intermediate
"I want to test and configure properly." — Understand the mechanics deeply.
Advanced
"I want to run robots professionally." — Infrastructure, monitoring, scaling.
Understanding Trading Robots
Foundation. Understand what these systems are and how they operate before touching anything.
What is an Expert Advisor (EA)?
An Expert Advisor (EA) is a program that runs inside MetaTrader (MT4 or MT5) and can automate trading operations. It monitors market data, applies predefined logic, and sends orders to the broker based on that logic. The EA does not think. It executes exactly what it was programmed to do.
Think of it as a highly disciplined assistant that follows a written rulebook without emotion, hesitation, or fatigue. It does not predict the future. It reacts to present conditions.
How does a trading robot work?
The core loop is simple. Market data flows in. The robot evaluates it. If conditions match the rule, an action is taken. Under the hood, the EA relies on the OnTick() event handler, which fires every time a new price tick arrives from the broker.
The robot does not connect to the market directly. It communicates with the broker's server, which executes the order. The robot's only job is to decide what to do and when — the broker handles the rest.
void OnTick() {
// 1. Check if we already have an open position
if (PositionsTotal() > 0) return;
// 2. Define entry logic (e.g., simple moving average cross)
double fastMA = iMA(_Symbol, _Period, 10, 0, MODE_SMA, PRICE_CLOSE, 0);
double slowMA = iMA(_Symbol, _Period, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
// 3. Execute trade if condition is met
if (fastMA > slowMA) {
// Send buy order logic here
}
}
Types of Robots
Different robots operate on different principles. Understanding how each type operates helps you evaluate whether a robot's behaviour matches your expectations.
| Type | How it operates | Key characteristics |
|---|---|---|
| Trend | Follows directional momentum. Enters when price moves in a sustained direction. | Can perform well in strong trends, poorly in sideways markets. |
| Grid | Places multiple orders at set intervals as price moves against the position. | Requires significant capital. High risk during extended trends. |
| Martingale | Increases position size after a loss to recover previous losses. | Extremely high risk. Can deplete an account rapidly. Understand the mechanics before use. |
| Scalping | Opens many small positions for very short durations to capture tiny price movements. | Sensitive to spread and slippage. Requires low-latency execution. |
| Hedging | Holds simultaneous buy and sell positions on the same symbol. | Complex to monitor. Understand margin implications. |
PipXGlobal does not recommend or endorse any robot type. This is educational information only. You are responsible for understanding any system before using it.
How to read a robot description
Before using any EA, examine its documentation carefully. Look for:
- Strategy type — Trend, grid, scalping, etc. Does it match your understanding?
- Recommended timeframe and symbol — Robots are often tuned for specific conditions.
- Risk settings — What controls exist? Can you limit drawdown?
- Backtest results — Are they provided? Over what period? What spread was assumed?
- Input parameters — Are they documented? Do you understand what each one does?
- Known limitations — Any honest vendor will state what the robot does not handle well.
If the description focuses on promises of profit rather than mechanics and risk, treat it with caution. Education means understanding how something works, not trusting a claim.
Myths vs Facts
| Myth | Fact |
|---|---|
| Robots never lose. | All automated systems can lose. No robot has perfect performance. |
| Robots can predict the market. | Robots react to current data based on rules. They do not predict the future. |
| You can set a robot and forget it forever. | Robots require monitoring, maintenance, and periodic review. |
| Higher price means better robot. | Price is unrelated to performance. Understanding the logic is what matters. |
Glossary of Terms
| Term | Meaning |
|---|---|
| EA | Expert Advisor — a program that automates trading in MetaTrader. |
| MQL4 / MQL5 | The programming languages used to write EAs for MT4 and MT5. |
| Algo Trading | Automated trading using algorithms or programs. |
| Backtest | Running a robot on historical data to see how it would have performed. |
| Forward Test | Running a robot on a demo account in real-time to observe behaviour. |
| Drawdown | The peak-to-trough decline in account equity. A measure of risk. |
| Equity | Account balance plus or minus open positions. |
| Balance | Closed profit/loss plus initial deposit. |
| Margin | Capital required to hold a position. |
MT5 Guide
MetaTrader 5 — the most comprehensive section. Everything from installation to advanced configuration.
What is MT5?
MetaTrader 5 (MT5) is a trading platform developed by MetaQuotes. It supports automated trading through Expert Advisors written in MQL5. MT5 is the successor to MT4 and includes additional timeframes, more technical indicators, an economic calendar, and a built-in strategy tester.
How to download and install MT5
MT5 is available for Windows, macOS, and mobile devices. To install on Windows:
- Visit the official MetaTrader website or your broker's download page.
- Download the MT5 installer for Windows.
- Run the installer and follow the on-screen instructions.
- Launch MT5 after installation completes.
For Mac, use the official MT5 application or a Windows VPS if you need full EA functionality. Mobile versions allow monitoring but cannot run Expert Advisors.
MT5 Interface Explained
The MT5 interface is divided into several key areas:
- Market Watch — List of available symbols. Right-click to show/hide symbols.
- Navigator — Contains Accounts, Indicators, Expert Advisors, and Scripts.
- Chart — The main price chart area. Right-click to change timeframe, template, or add indicators.
- Toolbox — Shows Trade, Exposure, News, Mailbox, Calendar, and Journal tabs.
- Strategy Tester — Accessible via View > Strategy Tester. Used for backtesting EAs.
How to install an EA on MT5
Installing an Expert Advisor on MT5 follows a clear sequence:
- Open MT5 and log in to your broker account.
- Click File > Open Data Folder.
- Navigate to MQL5 > Experts.
- Copy your EA file (
.ex5extension) into this folder. - Return to MT5. In the Navigator panel, right-click Expert Advisors and select Refresh.
- Your EA should now appear in the Navigator list.
- Drag the EA onto a chart, or right-click and select Attach to a chart.
How to configure an EA on MT5
When you attach an EA to a chart, a configuration window appears with several tabs:
- Inputs tab — Contains the EA's customizable parameters (lot size, stop loss, take profit, etc.).
- Common tab — Contains settings like Allow Algo Trading, Allow DLL imports, and Allow modification of signal settings.
For the EA to function, Allow Algo Trading must be checked in the Common tab, and the Algo Trading button in the main toolbar must be enabled (it appears green when active).
How to know if the robot is running
After attaching an EA, check the top-right corner of the chart. A small smiley face indicates the EA is running. A sad face or an "X" indicates it is not. Also check the Journal tab in the Toolbox for any error messages.
How to remove or change an EA
Right-click on the chart, select Expert Advisors > Remove. To change settings, right-click and select Expert Advisors > Properties (or press F7 while the chart is active).
MT5 Mobile
The MT5 mobile app allows you to monitor account balance, equity, open positions, and view charts. However, mobile versions cannot run Expert Advisors. EAs must run on a desktop or VPS instance of MT5.
MT4 Guide
MetaTrader 4 — still widely used. Learn its differences and how to operate EAs within it.
MT4 vs MT5 — Full Comparison
| Feature | MT4 | MT5 |
|---|---|---|
| Language | MQL4 | MQL5 |
| Timeframes | 9 | 21 |
| Indicators | 30 built-in | 38 built-in |
| Strategy Tester | Single-threaded | Multi-threaded |
| Economic Calendar | No | Yes |
| Depth of Market | Limited | Full |
| File format | .ex4 | .ex5 |
How to install an EA on MT4
- Open MT4 and log in to your broker account.
- Click File > Open Data Folder.
- Navigate to MQL4 > Experts.
- Copy your EA file (
.ex4extension) into this folder. - Return to MT4. In the Navigator panel, right-click Expert Advisors and select Refresh.
- Drag the EA onto a chart.
How to configure an EA on MT4
Similar to MT5, the configuration window has two main tabs: Inputs (for EA parameters) and Common (for settings like Allow live trading and Allow DLL imports).
To enable the EA, the AutoTrading button in the toolbar must be green, and Allow live trading must be checked in the Common tab. A smiley face on the chart confirms the EA is active.
MT4 Strategy Tester
Access via View > Strategy Tester. Select your EA, symbol, timeframe, and model. Click Start to run the backtest. Results appear in the Strategy Tester tab.
Installation & Configuration
Practical guides for installing and configuring any EA you already have.
How to install a .set file (preset settings)
A .set file contains pre-configured input parameters for an EA. To load it:
- Attach the EA to a chart and open its properties window.
- On the Inputs tab, click the Load button.
- Select the
.setfile from your computer. - Click OK to apply.
To save a configuration, use the Save button on the same tab. This allows you to share or reuse settings across accounts.
Every robot setting explained
| Setting | What it does |
|---|---|
| Lot Size | Determines the volume of each trade. Fixed lots use a constant size. Risk-based lots calculate size from account equity. |
| Max Spread | The maximum spread allowed when opening a trade. Prevents entries during poor market conditions. |
| Slippage | The maximum price deviation allowed between requested and executed price. |
| Magic Number | A unique identifier for each EA. Critical when running multiple EAs on the same account. |
| Risk % | The percentage of account equity risked per trade. A key risk management control. |
| Take Profit | The profit level at which a trade closes automatically. |
| Stop Loss | The loss level at which a trade closes automatically. |
| Trailing Stop | Moves the stop loss as the trade moves into profit, locking in gains. |
| Trading Hours | Restricts the EA to operating during specific times. |
| News Filter | Prevents trading around high-impact economic events. |
| Max Drawdown Protection | Stops the EA if account equity drops below a specified threshold. |
Magic Number explained
When multiple EAs run on the same account, each EA needs a unique Magic Number. This number allows each EA to identify which trades belong to it. If two EAs share the same Magic Number, they may interfere with each other's positions. Always ensure each EA has a distinct Magic Number.
How to test if your robot is working correctly — Checklist
- AutoTrading button is green.
- Smiley face appears on the chart.
- Journal tab shows no error messages related to the EA.
- The EA's inputs are configured as intended.
- Magic Number is unique (if multiple EAs).
- Demo account is used for initial testing.
- Backtest has been run and reviewed.
Indicators — How to Use with Robots
Indicators provide context. Learn what they show and how robots interact with them.
What is an indicator?
An indicator is a mathematical calculation based on price, volume, or other data that is displayed on a chart. Indicators help visualise market conditions. Robots often use indicator values as inputs for their logic.
How to install a custom indicator on MT5 / MT4
- Open the Data Folder (File > Open Data Folder).
- Navigate to MQL5 > Indicators (MT5) or MQL4 > Indicators (MT4).
- Copy the indicator file (
.ex5or.ex4) into this folder. - Refresh the Navigator panel by right-clicking Indicators and selecting Refresh.
- Drag the indicator onto a chart.
Indicators explained
| Indicator | What it shows | How robots use it |
|---|---|---|
| Moving Average | The average price over a set number of periods. | Trend direction, crossover signals. |
| RSI | Momentum — whether price is overbought or oversold. | Reversal signals, filter conditions. |
| MACD | Relationship between two moving averages. | Trend confirmation, momentum shifts. |
| Bollinger Bands | Volatility bands around a moving average. | Breakout or mean reversion triggers. |
| ATR | Average volatility over a period. | Dynamic stop loss and take profit sizing. |
| Stochastic | Momentum — position of price relative to a range. | Overbought/oversold conditions. |
Indicator settings explained
- Period — The number of bars used in the calculation. Shorter periods react faster but are noisier.
- Shift — Offsets the indicator forward or backward on the chart.
- Levels — Horizontal lines drawn at specific values (e.g., 70 and 30 on RSI).
Backtesting & Testing
Critical. Never run a robot live without understanding its historical behaviour.
What is backtesting?
Backtesting is the process of running a robot on historical market data to see how it would have performed. It is a simulation, not a guarantee. Backtesting helps you understand the robot's logic, its behaviour in different conditions, and its risk characteristics.
MT5 Strategy Tester — Complete guide
- Open View > Strategy Tester.
- In the Settings tab, select your EA from the Expert dropdown.
- Choose the Symbol and Period (timeframe).
- Select a Model (e.g., "Every tick" for highest precision).
- Set the date range for the test.
- Click Start.
Visual mode can be enabled to watch the test unfold on a chart. This is extremely useful for understanding how the EA behaves.
How to read backtest results
| Metric | Meaning |
|---|---|
| Net Profit | Total profit or loss after all trades. |
| Drawdown | The largest peak-to-trough decline in equity. A key risk measure. |
| Win Rate | Percentage of trades that were profitable. |
| Profit Factor | Gross profit divided by gross loss. Above 1.0 means profitable. |
| Trades | Total number of trades executed during the test. |
Common backtesting mistakes
- Overfitting — Optimizing a robot to perform perfectly on historical data at the expense of future performance.
- Bad data — Using incomplete or poor-quality historical data.
- Wrong spread — Testing with unrealistic spreads that do not match live conditions.
Backtest checklist before going live
- Backtest covers a sufficiently long period (multiple market conditions).
- Spread assumption is realistic for your broker.
- Drawdown is within your tolerance.
- You understand the robot's logic and why it takes trades.
- Demo forward test has been run for at least 2–4 weeks.
- All risk settings are configured correctly.
VPS Setup & Automated Trading Infrastructure
Advanced. Run robots 24/7 with reliable infrastructure.
What is a VPS?
A VPS (Virtual Private Server) is a remote computer that runs continuously. It allows your MT4 or MT5 platform — and therefore your robots — to operate without interruption, even when your own computer is off or disconnected from the internet.
How VPS works
How to choose a VPS
- RAM — At least 2–4 GB for running MT4/MT5 with multiple EAs.
- CPU — A modern dual-core or better.
- Latency — Choose a VPS located near your broker's servers for faster execution.
- Location — Ideally in the same data centre region as your broker.
Step-by-step: How to set up Windows VPS for MT5/MT4
- Choose a VPS provider and select a Windows Server plan.
- Deploy the VPS and obtain login credentials (IP address, username, password).
- Connect to the VPS using Remote Desktop (Windows) or a compatible client.
- Download and install MT5 or MT4 on the VPS.
- Log in to your broker account.
- Install your EA as described in the MT5/MT4 installation guides.
- Configure the EA and enable AutoTrading.
- Disconnect from the VPS — it continues running independently.
Monitoring and troubleshooting
Regularly check the VPS is running, MT5/MT4 is connected to the broker, and the EAs are active. Use the Journal tab to review any errors. Keep the VPS updated and secure.