Skip to content

CFDs are leveraged products. CFD trading may not be suitable for everyone and can result in losses that exceed your deposits, so please ensure that you fully understand the risks involved. CFDs are leveraged products. CFD trading may not be suitable for everyone and can result in losses that exceed your deposits, so please ensure that you fully understand the risks involved.

How to create an automated forex trading system

An automated forex trading system executes trades on your behalf using the exact parameters that you have set. Learn how to create, backtest and run an automated forex trading system for platforms, including MT4 and ProRealTime.

Forex Source: Bloomberg

What is a forex trading system?

A forex trading system is essentially a set of rules used to execute trades on one or more currency pairs. While these systems can be implemented manually, many traders use automated systems – based on computer code – to take emotion out of the equation and execute trades more efficiently. These automated systems are effectively ‘trading robots’ that can monitor the markets at any time of day, looking for opportunities and executing trades according to a set script.

Creating vs buying an automated forex trading system

You can create an automated forex trading system for many of the platforms that IG offers, including MetaTrader 4 (MT4), ProRealTime, and our regular online trading platform via an API. With MT4 and ProRealTime, it’s also possible to buy and install pre-built systems made by a third party.

Building a custom system

The main benefit of building a custom system is that the options are practically limitless – the only constraints being your imagination and what can be coded. However, building a bespoke system will require an in-depth understanding of financial markets, trading and technical analysis . You’ll also need to convert your system into code, though it is possible to hire a developer once you have designed the system on paper.

Buying an off-the-shelf solution

If you use MT4 or ProRealTime, you also have the option of buying an off-the-shelf solution, known as an ‘Expert Advisor’ (EA) on MT4 and an ‘automated trading strategy ’ on ProRealTime. While using one of these systems is much easier than coding a strategy from scratch, it’s important to research and test any third-party solution thoroughly to make sure it fits in with your trading goals and actually does what it says. This is because many third-party solutions make bold claims – like being the ‘best forex trading system ’ – but fail to live up to the hype.

How to build an automated forex trading system

If you’ve decided you want to build your own automated forex trading system, here’s how to get started:

Create a trading plan

To get the most out of your time on the markets, it’s a good idea to create a detailed trading plan – a blueprint for your trading activity that can help you define your aims and how your automated system will help you achieve them. Among other factors, it is useful to consider:

  • Which market (or markets) you want your system to trade
  • When you want it to operate
  • What its risk-reward ratio should be
  • What strategy it will use

Design your system

Once you’ve decided what you want your system to do, the next step is to work out how this will be achieved. In particular, it’s important to consider how your system will actually identify trading opportunities, and what you want it to do when it finds one. It could place trades on your behalf or simply send you an alert.

When designing your system, it can be helpful to think about the tools and indicators you normally use to identify trends (such as RSI and moving averages) and how you decide when to place trades. Remember, most automated trading systems rely on technical analysis, rather than fundamental analysis, so a good knowledge of this area and how it can inform your trading is critical.

Choose risk management tools

The most important part of designing your system is deciding what risk management tools it will use – so important, in fact, that we’ve included it as a separate step here. With IG, you’ll have access to up to three types of stop, depending on which platform you are using:

  • A basic stop closes your position as near as possible to the price level you specify. This can sometimes be at a worse price than requested if the market moves quickly or ‘gaps’
  • A guaranteed stop always closes your position at the level you specify. You’ll pay a small premium if the stop is triggered
  • A trailing stop follows positive price movements to lock in profits. Again, the stop level is not guaranteed so it could slip if the market moves quickly

You can also use a limit to automatically close a trade if the price moves to a more favourable level. Unlike a stop, if a limit is triggered and filled it will be at your chosen price or better.

Build your automated forex trading system

Once you’ve designed your system on paper, the next step is to convert it into code. Each platform uses a different coding language, so you’ll need to design your system for the specific platform you plan to use.

While it’s helpful to have an understanding of what can be coded, you don’t need to have an in-depth knowledge of coding yourself. This is because it is always possible to hire a developer to create your system for you. To find out more about how to find and hire a developer, contact our technical support team.

Backtest and refine your automated forex trading system

The final step involves backtesting your trading system using historical data, and refining it to achieve your desired metrics – for example, a high percentage of winning trades or low drawdown.

This is a very important step – whether you have chosen to buy an off-the-shelf system or build your own – as it will give you a fair idea of how the system is likely to perform without putting your capital at risk.

However, while backtesting is a useful way to gauge the efficacy of your system, it does have limitations. Static data is not always representative of what will happen in a live trading situation, as it may not take factors such as liquidity into account.

Running your trading system

Once you’ve set up and optimised your system, it’s time to put it into action. However, ‘automation’ doesn’t mean you can simply walk away from your computer. You must always keep an eye on what’s happening in case of unexpected problems or changing market conditions, as even the best automated trading systems will have some flaws or quirks.

What’s more, they generally ‘make decisions’ based on technical analysis alone, so may not be geared up to assess the effects of economic events or other market conditions – factors a human trader may consider as part of their fundamental analysis.

IGA, may distribute information/research produced by its respective foreign affiliates within the IG Group of companies pursuant to an arrangement under Regulation 32C of the Financial Advisers Regulations. Where the research is distributed in Singapore to a person who is not an Accredited Investor, Expert Investor or an Institutional Investor, IGA accepts legal responsibility for the contents of the report to such persons only to the extent required by law. Singapore recipients should contact IGA at 6390 5118 for matters arising from, or in connection with the information distributed.

The information/research herein is prepared by IG Asia Pte Ltd (IGA) and its foreign affiliated companies (collectively known as the IG Group) and is intended for general circulation only. It does not take into account the specific investment objectives, financial situation, or particular needs of any particular person. You should take into account your specific investment objectives, financial situation, and particular needs before making a commitment to trade, including seeking advice from an independent financial adviser regarding the suitability of the investment, under a separate engagement, as you deem fit.

Please see important Research Disclaimer.

Explore the markets with our free course

Discover the range of markets you can trade CFDs on - and learn how they work - with IG Academy's online course.

Turn knowledge into success

Practice makes perfect. Take what you’ve learned in this forex strategy article, and try it out risk-free in your demo account.

Ready to trade forex?

Put the lessons in this article to use in a live account. Upgrading is quick and simple.

  • Trade over 80 major and niche currency pairs
  • Protect your capital with risk management tools
  • Analyse and deal seamlessly on smart, fast charts

Inspired to trade?

Put the knowledge you’ve gained from this article into practice. Log in to your account now.

You might be interested in…

Find out what charges your trades could incur with our transparent fee structure.

Discover why so many clients choose us, and what makes us a world-leading provider of CFDs.

Stay on top of upcoming market-moving events with our customisable economic calendar.