We use cookies to give you the best possible experience on our website. By continuing to browse this site, you give consent for cookies to be used. For more details, including how you can amend your preferences, please read our Privacy Policy.
More Info Accept
81% of retail accounts lose money when trading CFDs with this provider. CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 81% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. expand_more

Ultimate guide to algorithmic trading

July 15, 2020 16:59 UTC
Reading time: 18 minutes

Did you know that more than 80% of the moves in the US stock market and Forex market are done by machine-based, algorithmic trading robots? Fortunately, with significant advances in technology, algorithmic trading strategies are now accessible for all types of traders across nearly all major markets and is just one reason this form of trading is becoming increasingly popular.

In this ultimate guide you will learn:

  • What is algorithmic trading and why it is becoming increasingly popular.
  • What the best algorithmic trading software is and how to access it for FREE.
  • How to use algorithmic trading strategies without learning a single line of coding or a programming language!
  • How to get started with algorithmic trading in a virtual trading environment by opening a FREE demo trading account with Admiral Markets UK Ltd.

Algorithmic trading

What is algorithmic trading?

Algorithmic trading, otherwise known as algo trading or black-box trading is where the execution of orders are automated through programmed trading instructions. These instructions are lines of code that detail instructions on when to buy and sell and may include chart analysis, volatility analysis, price arbitrage analysis or just simple trend following price movements.

Investment banks and large hedge funds spend millions a year on trading teams that specialise in building black-box trading models to get an edge in the market. This usually consists of PhD scientists, mathematicians and engineers. One of the biggest attractions to black-box trading models is the fact that they remove human error. Managing emotions like fear and greed are the biggest obstacle for all human traders - a problem algo trading strategies simply do not have.

Many algo traders are also attracted to the fact an algorithmic trading strategy can trade 24 hours a day. It is just one reason why they are not only used by independent traders but also hedge funds, investment banks and large mutual funds. While most of the transactions made in financial markets are now done by some form of algo trading model, concerns still remain.

The volatility during the 6 May 2010 Flash Crash in which the Dow Jones Industrial Average stock market index crashed over 600 points but then recovered in just a few minutes was largely attributed to algorithmic and high-frequency trading strategies, of which there are quite a few running at any one point in time.

One of the most popular algorithmic trading software available for retail traders is the MetaTrader 4 trading platform which you can download for FREE via Admiral Markets. You can download it for free today by clicking on the banner below which will also help you follow through on some of the next examples.

Trade Algorithmic Trading Strategies With MetaTrader 4

Algorithmic trading strategies

There is a large variety of algorithmic trading strategies in operation and new, advanced ones are constantly being created. However, the core strategies of what these algos do can be broken down into the following categories:

Index re-balancing strategies

Most pension funds and retirement accounts often invest heavily into index funds which need to be 're-balanced' periodically to adjust to new underlying prices and market capitalisation of the underlying securities it tracks. This re-balancing creates unique opportunities for algo traders who exploit the expected trades that are due to take place before the re-balancing of the fund.

This type of strategy is the domain of algorithmic traders as trades are taken within nano-seconds to get the best prices. Most retail trading platforms won't support this type of trading strategy either and is mostly geared for quantitative trading hedge funds who specialise in such high-frequency types of trades.

High-frequency arbitrage trading strategies

Arbitrage refers to the practice of finding opportunity in the price difference between two or more markets. This can happen when the same market is traded across different exchanges. For example, the price of Bitcoin can often differ between the various cryptocurrency exchanges.

Another example is when the S&P 500 stocks move ahead or behind the S&P 500 index futures contract, due to the fact that stocks and futures contracts are traded on different exchanges. S&P 500 stocks are traded at the New York Stock Exchange and NASDAQ Exchange, while the S&P 500 index futures contract is traded at the Chicago Mercantile Exchange (CME).

While the concept is quite simple, in practice, only algorithmic trading robots can take advantage of these price differences as they may only happen for a few seconds or less. Therefore, this type of strategy is mainly designed for high-frequency traders with access to the best speeds and execution models. Most institutional traders utilising high-frequency arbitrage trading strategies will have internet cables connecting directly to these exchanges to take trades within nano-seconds.

Mean reversion trading strategies

Mean reversion is the effect of a market's price trading back to its historical average price. This type of strategy is usually based on a mathematical model that assumes an asset's high or low price is temporary and will move back to its average price over a period of time.

Technical trading indicators such as moving averages and Bollinger bands are widely used in mean reversion trading strategies. This is due to the fact a moving average provides the average historical price of an asset, while the Bollinger bands help to identify a market that has moved too far away from an average, using standard deviation as a measure of its volatility.

Below is an example chart taken from the MetaTrader 4 trading platform provided by Admiral Markets showing two technical trading indicators: the 100-period exponential moving average shown by the purple line and Bollinger bands (20,2,) shown by the green lines. There are certain occasions, or market conditions, where price often trades between the upper and lower Bollinger bands, reverting back to the middle of the bands which is most commonly the 20-period moving average. In the right market conditions, traders will often use volatility indicators like this for mean reversion trading strategies.

Algorithmic trading MT4

A screenshot of the MetaTrader 4 trading platform provided by Admiral Markets showing the 100-period exponential moving average and Bollinger bands (20,2).

Disclaimer: Charts for financial instruments in this article are for illustrative purposes and does not constitute trading advice or a solicitation to buy or sell any financial instrument provided by Admiral Markets (Contracts for Difference, Exchanged Traded Funds, Shares). Past performance is not an indication of future performance.

This type of trading strategy can be more suited to retail traders who trade on a higher timeframe such as the daily, four-hour and one-hour chart. The indicators can be found on most trading platforms and are already used by most traders manually. Of course, the specialisation comes in when trying to code and program the strategy. However, traders don't need to learn how to code to take advantage of algo trading strategies as you will learn further down this article.

Machine learning AI trading strategies

A relatively new form of algorithmic trading is the use of machine learning and artificial intelligence (AI). Most algo strategies are only as good as the predetermined inputs in the programming language created by the trader and programmer. With machine learning AI trading strategies, the trading robot updates itself on what has and has not been working.

Well-known hedge-fund manager Ray Dalio of Bridgewater Associates runs one of the largest hedge-funds in the world with more than $160 billion in assets under management. After nearly bankrupting his firm through a wrongly predicted trading idea, Dalio re-evaluated his methods and moved to a systemised method called the Pure Alpha fund strategy. It is mostly algo based and has been one of the main contributors to Dalio's success.

The hedge fund is now trying to develop this strategy into an artificially intelligent program, moving towards a more algorithmic-based approach. It is a groundbreaking area that will be out of reach for most retail traders and even most investment banks at such an early stage in its development.

Did you know that you can also access some of the best advanced trading tools and indicators available to retail traders by upgrading your MetaTrader trading platform to the Supreme Edition? In this supercharged version - which is completely FREE to download and upgrade to - you can access a range of different technical indicators, sentiment and correlation tools. Get started today by clicking the banner below:

Trade Algorithmic Trading Strategies With MetaTrader Supreme Edition

Trend-following momentum trading strategies

This is a popular type of algorithmic trading strategy used by all types of traders, both large and small. The idea is that if a trend is in place then the market could continue in that direction until there are signals it has come to end. This is actually one reason why movements in the financial markets have changed considerably over time. Nowadays price moves tend to go much further and faster due to a lot of algorithms jumping on board the move very quickly.

Many retail traders would employ the use of technical trading indicators such as moving averages to help identify the long-term trend, as well as indicators to help identify overbought or oversold conditions. Instead of being there themselves to analyse the right time where all these conditions line up, they may code their strategy into an algo trading system which will then automatically search for these conditions and place trades according to user-defined parameters - saving a huge amount of time.

For example, below is a chart taken from the MetaTrader 4 trading platform provided by Admiral Markets with a blue 20-period moving average line, a red 50-period moving average line and a Stochastic Oscillator (5,3,3) indicator window at the bottom. Manual traders will often look to initiate long positions when the faster-period moving average (such as the 20-period) is higher than the slower-period moving average (such as the 50-period) and also look for short positions when the faster-period moving is lower than the slower-period moving average.

Algorithmic trading MT4

A screenshot of the MetaTrader 4 trading platform provided by Admiral Markets showing the 20-period and 50-period exponential moving average and the Stochastic Oscillator (5,3,3) window.

Disclaimer: Charts for financial instruments in this article are for illustrative purposes and does not constitute trading advice or a solicitation to buy or sell any financial instrument provided by Admiral Markets (Contracts for Difference, Exchanged Traded Funds, Shares). Past performance is not an indication of future performance.

Oscillators such as the Stochastic are often used as signs of overbought or oversold conditions. Manual traders would look to initiate long positions when the moving averages indicate an uptrend with price at an oversold level, as well as short positions when the moving averages indicate a downtrend with price at an overbought level. Algorithmic traders would look to code these conditions into an automated trading system, allowing the algo to take trades automatically when the pre-programmed conditions have been met, thereby saving time for the trader.

The above list represents some of the most common types of algorithmic trading strategies. Unfortunately, many of them will be difficult to implement for most retail traders with zero or limited knowledge in a programming language. It will also be futile to try and compete with large investment banks and specialised quantitative hedge funds who have more capital, resources, knowledge and speed.

But there are ways retail traders can begin their journey with algorithmic trading via the MetaTrader trading platform provided by Admiral Markets.

The best algorithmic trading software

There are lots of different types of algorithmic trading software offered in the marketplace. While most investment banks will create their own customised versions there is one platform that is widely used by retail traders all around the world.

The MetaTrader trading platform is arguably the world's most popular trading platform and offers an array of algorithmic trading components for those versed in coding and those who are not. Through this platform, users can take advantage of 'trading robots' that have been programmed using the MQL4 (MetaQuotes 4) language for MetaTrader 4 and MQL5 (MetaQuotes 5) language for MetaTrader 5 into an Expert Advisor.

Admiral Markets offers the following MetaTrader suite of products with algorithmic trading capabilities offered on the desktop applications:

Both desktop platforms allow users to develop, test and apply Expert Advisors for automated, algorithmic trading. Experienced algo traders can use a variety of features designed specifically for automated trading. This includes:

  • The use of the MQL5 and MQL4 programming language which offers high calculation speed with C++ like syntax.
  • A MetaEditor for strategies which provides a debugger and compiler.
  • A StrategyTester for visual testing and optimization.
  • An MQL4 and MQL5 community to interact with other Expert Advisor developers.

Fortunately, for those not versed in programming language and for those who have no desire to learn such specialised skills, MetaTrader offers the MQL5 Marketplace and MQL4 Marketplace which is an online store filled with free and paid-for versions of trading robots and customised indicators.

Before we look at how to access algorithmic trading strategies in MetaTrader, follow the next steps to download your MetaTrader algorithmic trading platform which can be done for free. You can also create an account with Admiral Markets to open a demo trading account so you can use your MetaTrader trading platform to trade in a virtual trading environment until you are ready to go live.

Free Forex Demo Trading Account for Algorithmic Trading Strategies

How to download the MetaTrader algorithmic trading platform

To start your free download of the MetaTrader 4 trading platform provided by Admiral Markets simply visit the Admiral Markets MetaTrader download page, as shown below:

Algorithmic trading MT4 download

A screenshot of the MetaTrader 4 download page from Admiral Markets.

After clicking on 'download', your download will begin and you will be given instructions on how to install the platform for your chosen device such as Windows or Mac. Once downloaded you will need login credentials of a demo or live trading account.

To open a demo or live trading account, simply visit the Admiral Markets website and click on ' Create Account'. This will take you to a signup page which only requires your first name, last name and email. Once you have gone through these stages you will gain access to the Admiral Markets Traders Room Dashboard. From here you can open a live trading account or demo trading account.

You can use a demo trading account to access algorithmic trading strategies in both MetaTrader 4 and MetaTrader 5 as explained in the next session.

Accessing algorithmic trading strategies in MetaTrader 4

Through the MQL4 Market, traders can access an online store with free and paid-for trading robots and customised technical trading indicators. Better yet, all of these can be tested in the MQL4 Strategy Tester for free before buying. It's always worthwhile testing out anything in the Marketplace on a demo trading account first and foremost so you can see how it performs in different trading conditions over a period of time.

The MQL4 Market can be found in the MetaTrader 4 trading platform provided by Admiral Markets in the Terminal window (Ctrl+T) and then by clicking the Market tab. At the bottom, there is a tab called Market. In here, there are further tabs called Main, Experts, Indicators, Libraries, Utilities, Favorites and Purchased.

The Experts tab is full of different automated strategies covering different types of strategies which include Trend, Scalping, Level trading, Multicurrency, Grid, Martingale, Hedging, Neural Networks, News, Arbitrage and Other Applications.

The MQL5 Market can be found in the MetaTrader 5 trading platform provided by Admiral Markets in the Toolbox window (Ctrl+T). You can learn more about the MQL5 Community in the Ultimate MQL5 Guide.

Algorithmic trading MT5 Market

A screenshot of the MetaTrader 5 trading platform provided by Admiral Markets showing the MQL5 Market -> Experts tab in the Toolbox window.

Did you know that you can also download the newest version of MetaTrader, the MetaTrader 5 trading platform completely FREE via Admiral Markets? In this multi-asset class trading platform, there are additional features such as more chart types and viewable timeframes. You can start your download for free today by clicking on the banner below:

Trade Algorithmic Trading Strategies With MetaTrader 5

Setting up an algorithmic trading expert advisor

There are two options in setting up an algorithmic trading expert advisor (EA) to perform automated trading functions, that we will run through next using the MetaTrader 4 (MT4) trading platform.

The first way is to create your own EA by opening the MetaEditor programme which can be done by clicking F4 in the MT4 platform. Once here, you can click 'New' which will launch the MQL4 Wizard which will then guide you through how to create an EA.

The second way is to download and install an EA from the MQL4 Market section or pay a programmer and work with them to create your own EA with your own rules and parameters. To start using an EA downloaded from the Experts section in MT4, simply open the Navigator window (Ctrl+N) and select Expert Advisors where you will see your downloaded EAs.

In the screenshot below, we downloaded the first free EA for example purposes only. No due diligence has been done on the effectiveness of this EA. From downloading it in the MT4 Experts window, it now appears in the Navigator window under Expert Advisors.

Algorithmic trading MQL4

A screenshot of the MetaTrader 4 trading platform provided by Admiral Markets showing the MQL4 Market -> Experts tab and the Navigator window.

From here, simply drag it onto the chart in the MT4 platform to start using it. You can also use the Strategy Tester function from the View menu at the top of the platform and test a strategy for different symbols and over a chosen time period. This will also give you a visual walkthrough of the trades it has taken, as the screenshot shows below:

Algorithmic trading MQL4 walkthrough

A screenshot of the MetaTrader 4 trading platform provided by Admiral Markets showing the Strategy Tester visual walkthrough function.

Why trade algorithmic trading strategies with Admiral Markets?

  • Trade from the popular online trading platform MetaTrader 4 and MetaTrader 5 for PC, Mac, Web, Android and iOS operating systems.
  • Access the MQL4 and MQL5 Market to find algorithmic trading robots and test them in a virtual environment by opening a free demo trading account.
  • Start to trade with a well-established company that is authorised and regulated by the Financial Conduct Authority (FCA), among other financial regulators.
  • Access a broad range of CFD (Contracts for Difference) instruments covering Forex, Stocks, Indices, Commodities and Cryptocurrency CFDs.

You can get started today by clicking on the banner below and opening your free demo trading account.

Trade With A FREE Demo Trading Account for Algorithmic Trading

About Admiral Markets

Admiral Markets is a multi-award winning, globally regulated Forex and CFD broker, offering trading on over 8,000 financial instruments via the world's most popular trading platforms: MetaTrader 4 and MetaTrader 5. Start trading today!

This material does not contain and should not be construed as containing investment advice, investment recommendations, an offer of or recommendation for any transactions in financial instruments. Please note that such trading analysis is not a reliable indicator for any current or future performance, as circumstances may change over time. Before making any investment decisions, you should seek advice from independent financial advisors to ensure you understand the risks.