Expert Advisors

Discover how to automate your MT4 with Expert Advisors, the ‘forex trading robots’ that can help you start algorithmic trading.

What are Expert Advisors?

Expert Advisors (EAs) are programs that run on the MetaTrader platform, used to monitor and trade financial markets using algorithms: finding opportunities according to set parameters, then either notifying you or opening a position automatically. And once your position is open, an EA can add close conditions including stops, trailing stops and limits.

You could, for example, use an EA to monitor a few key markets, alerting you when it finds a chance for potential profit. Or you could let it loose on the markets completely, opening multiple positions each day with little human input.

For most traders, EAs are primarily used for forex trading. But you can use them to trade any market that’s available on your MT4. If you’re an IG client, for example, you can use an EA to trade forex, indices, cryptocurrencies and commodities on an enhanced MT4.

Find out more about MetaTrader 4 with IG

How do Expert Advisors work?

Expert Advisors work by enabling you to set the parameters by which opportunities are found, positions are opened and close conditions are added – essentially using a set of yes/no rules to trigger trading decisions. You can either build an EA for yourself, or import one that someone else has built.

By combining lots of yes/no rules into a complex mathematical model, Expert Advisors can execute sophisticated trading strategies, using computational power to make decisions – and act upon them – almost instantly.

Expert Advisor example

A simple Expert Advisor could monitor one or two markets, notifying you about potential trades when set conditions are fulfilled.

Say, for instance, that you wanted an EA to spot any mean reversion opportunities on GBP/USD using the 20-day SMA indicator. You could import one that someone else has built, or you could build one yourself using a programming language called MQL4. 

You’d program your EA to monitor GBP/USD constantly, watching for any times that GBP/USD breaks out of its 20-day SMA and notifying you along with details of the move.

You could then program your EA to act upon the opportunity instead of just notifying you, for example by using 2% of your total available balance as the size of the position. From there, how complicated your EA gets is entirely up to you. 

Get started

Open an account today and start using MT4 with IG immediately

Why are Expert Advisors popular?

  • Timesaving

    A correctly-programmed Expert Advisor can monitor hundreds of markets, meaning you don’t have to watch price movements 24 hours a day in order to find new opportunities. How much time you dedicate to the markets is up to you: use you EA for trading alerts but open and close positions yourself, or merely keep an eye on your running profit or loss. 

  • Emotionless trading

    Emotion can be problematic to your bottom line. It might encourage you to hold on to a losing trade for longer than you should, because you don’t want to realise the loss. Or dive into a reckless trade too quickly, riding high off a big win. Automating your trading helps take the emotion out of your decision making – an algorithm only views the markets in black and white. 

  • Flexibility

    Building a strategy is just the beginning, and trusting it to take care of your capital is a big step to take. That’s why most traders will backtest their Expert Advisor before letting it loose on live markets. Backtesting involves running your strategy against a chunk of real historical data and seeing how it performed, helping you to iron out any issues before they end up losing you real money.

    However, it’s important to note that backtesting isn’t completely foolproof. Slippage, for example, can’t affect your trades when backtesting – but can be an issue once you set your EA live. 

  • Backtesting

    Building a strategy is just the beginning, and trusting it to take care of your capital is a big step to take. That’s why most traders will backtest their Expert Advisor before letting it loose on live markets. Backtesting involves running your strategy against a chunk of real historical data and seeing how it performed, helping you to iron out any issues before they end up losing you real money.

    However, it’s important to note that backtesting isn’t completely foolproof. Slippage, for example, can’t affect your trades when backtesting – but can be an issue once you set your EA live. 

  • Accessibility

    While undoubtedly major benefits, in truth the above four points all apply to any automated trading system – not just Expert Advisors. But while building a trading algorithm from scratch can be complicated, importing an EA just means choosing a program and suiting it to your needs. 

    The easy accessibility of EAs is probably the biggest reason for their popularity as an automated trading tool. But while a well-coded, fully backtested and properly monitored Expert Advisor can be hugely beneficial to your trading, there are some major pitfalls to avoid that all traders should be aware of.

Risks of Expert Advisors

  • Inexpert advisors

If the promise of a program that beats the returns of the world’s best fund managers at a fraction of the cost sounds too good to be true, then it’s because it probably is. But that’s the promise being sold by lots of readymade Expert Advisors.

So if you’re planning on buying a readymade EA, doing your research to make sure that you don’t get burned is imperative. 

  • Lack of human interaction

However sophisticated your EA is, it’s no match for the human brain. And while taking some of the emotion out of your decision making is often useful, removing it entirely can bring new problems. It is always important to keep track of how an EA is performing and if it is in line with your trading logic.

  • Not always online

Unlike a web trading platform, to run MT4 you have to install it. This means that you can only access it from the device you install it on, and your EAs can only run when that PC is switched on, with MT4 up and running and connected to the internet. 

If you want your EA to run round the clock, you’ll need a virtual private server.

What is a virtual private server?

A virtual private server (VPS) is an online version of your MT4 that is hosted on an external server, enabling your EAs to operate even when your PC is switched off. It solves the problem of needing your PC or mobile device to be running MT4 in order for your EA to function, by hosting an instance of your MT4 on an external server that is always on.

If you’re an IG client, you can get an MT4 VPS from Beeks entirely free of charge if you maintain a balance of £5000 or more. Otherwise, it costs £50 per month.

That isn’t the only reason to trade on MT4 with IG, though. You also get access to a range of free MT4 indicators and apps, as well as spreads starting from just 0.6pts on EUR/USD.

How to build an Expert Advisor

Expert Advisors for MT4 for are built using a programming language called MetaQuotes Language, or MQL. Just like any programming language, getting up to speed with the ins and outs of MQL requires a significant investment of time and effort. You can find guides on the MQL site.

You can also build simple EAs using MT4’s inbuilt wizard, or an external strategy-building tool. These visualise the code that is being written underneath, enabling you to put together strategies without learning a whole new programming language.

However you choose to build your EA, it’s hugely important to test it out rigorously before you let it trade using real capital.

Open an IG account now

It's free to open an account, takes less than five minutes, and there's no obligation to fund or trade.

FAQs

How do I install an Expert Advisor?

To install an Expert Advisor on MT4, you’ll need to copy it onto the ‘experts’ folder where your MetaTrader 4 is installed. This is usually located on the ‘c:’ drive.

Once that’s done, launch MT4 and expand the ‘Expert Advisors’ section on the left-hand side. Your EA should be located there. Drag it onto a chart to get started, and you’ll be asked to review its settings before setting it live.

Don’t set an EA live before you’ve thoroughly tested it out, though, because you need to be 100% confident in it before you let it trade live markets. If you’re downloading an EA instead of building it yourself, do your due diligence and avoid any offerings that promise more than they can deliver.

How can I backtest my Expert Advisor?

You can backtest an EA on MT4 using the strategy tester, which you’ll find by clicking ‘view’ in the top navigation bar. In the tester, select the EA you want to run, as well as the market and timeframe you want to run it against. You can also select the modelling quality – ‘every tick’ is the most precise method.

Can I test my Expert Advisor on a demo account?

Yes, you can run Expert Advisors on a demo version of MT4. Just install the EA in exactly the same way as on a live account, and set it running on your chosen markets. 

Try a free MT4 demo

Can I build a Custom Indicator with an Expert Advisor?

A Custom Indicator is a technical indicator that you build yourself – like an Expert Advisor, but programmed for analysing the markets instead of monitoring and trading them. You build them using MQL, and once built can use your Custom Indicator as part of an EA strategy.

You might be interested in...

  • Execution and pricing

    Our technology is engineered for speed, stability and better prices.

  • Risk management

    Protect profits and limit losses with our range of risk management tools.

  • ProRealTime

    Integrated access to the leading web-based charting package.

Help and support

Get answers about your account or our services.

Get answers

Or ask about opening an account on 0800 195 3100 or newaccounts.uk@ig.com.

We're here 24hrs a day from 8am Saturday to 10pm Friday.

Spread bets and CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 79% of retail investor accounts lose money when trading spread bets and CFDs with this provider. You should consider whether you understand how spread bets and CFDs work, and whether you can afford to take the high risk of losing your money. Spread bets and CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage.