Algorithmic trading

Algorithmic trading is the process of using a computer program that follows instructions based on mathematical formulae, in order to make automated trading decisions.

By following the algorithm’s instructions, the computer makes the decisions for the trader as to whether to buy or sell various financial instruments, often by monitoring price charts. It will exit the position upon meeting the algorithm’s specified requirements.

Algorithmic trading is an effective way of minimising risk when executing an order, as once the trader has chosen the model’s predefined principles, such as the exit price and position size, the computer makes the decisions based on this information. This lessens the likelihood of the trader making decisions based on emotion, rather than logic.

Automated trading software is predominantly used by hedge funds and investment banks, as algorithmic trading is most suitable for large orders, whether that be size or volume. Over 75% of share trades on U.S. stock exchanges originated from automated trading systems.

algorithmic trading uses mathematical data for stocks

Algorithmic trading strategies

There are numerous algorithmic trading strategies which can be adopted by traders in order to save themselves both time and money.

High-frequency trading

This automated trading strategy involves placing a high volume of trades at a rapid speed in order to profit from small movements in price. Typically, the positions will be open for less than a minute or for just milliseconds. The aim of high-frequency trading is to make small profits, so there are often very high volumes of these trades occurring in one day. An algorithmic strategy for high-frequency trading is called scalping. In particular, scalping forex is common for trading currency pairs.

Arbitrage trading

Arbitrage strategies involve using an algorithm to monitor the market to find price differentials. This could be when two assets with identical cash flows aren’t trading at the same price, or when the same asset isn’t trading at the same price on all markets.

This could be useful if, for example, a stock is valued at one price on the New York Stock Exchange, but for less on the London Stock Exchange. This stock could be bought at the lower price on the NYSE, then sold on the LSE for a profit.

As these price differentials aren’t very common, it is useful to have an algorithm to locate them when they do occur. As these price differentials are often small, a large position is generally required to make a significant profit, such as in pairs trading.

Trend following

Automated trading systems can be used to monitor the market and various price charts, identifying patterns that identify the best time to execute a trade. The algorithm can base these patterns on trends that occur in both historical and current data, but trends can also be based on technical indicators, stochastic indicator, price movements, moving averages and mean reversion.

Mean reversion

This algorithmic strategy makes the assumption that even if the price of a stock deviates due to common factors such as breaking market news, over time it will move back to the average price. The trading range of a particular asset needs to be identified, then the computer can detect the average price using analytics. Typically, the average asset price is calculated using historical data.

VWAP trading

The VWAP, volume-weighted average price, is a benchmark that traders can use to execute an order as close to the average intraday price as possible. This intraday calculation looks to calculate an asset’s typical price by multiplying it with volume for a selected period (e.g. 1 minute). You then keep a running total of cumulative TPV and cumulative volume, just adding volumes for each 1-minute period, or for whichever period the trader has selected, and then divide cumulative TPV by cumulative volume.

These algorithmic trading statistics will not be useful for determining trends as they are purely a historical average for that day. They can, however, be used to gauge whether or not a trader has overpaid for an asset earlier than its trading day.

TWAP trading

The TWAP trading strategy (time-weighted average price) aims to execute the order as close to the average price of the security as possible, over a specific time period. This is often over the course of one day, and a large order will be split into multiple small trades of equal volume across the trading day. The purpose of this algorithmic trading strategy is to minimise the market impact by executing a smaller volume of orders, as opposed to one large trade which could impact the price.

Forex algorithmic trading

When trading the forex market, the efficiency of algorithmic trading online means fewer hours spent monitoring the markets, as well as lower costs to carry out the trades. Algorithmic trading can also be useful when hedging trades, in particular, spot contracts, where foreign currencies are bought or sold for instant delivery.

Triangular arbitrage is one common forex algorithmic trading strategy. It involves currency trading in the forex market with exchange rate discrepancies for an overall profit. This popular forex strategy involves three stages:

  • Firstly, exchanging the initial currency (a) for a second (b)
  • Then exchanging the second currency (b) for the third (c)
  • And finally, exchanging the third currency (c) for the first (a)

The automated strategy is conducted exclusively via a computer, partially due to the rare occurrence of these opportunities, but also due to the speed at which the trades need to be carried out. A large amount of capital would typically be traded due to the fractional differences between currency prices.

Benefits of algorithmic trading

  • It avoids the likelihood of human error, caused by factors like emotion or fatigue.
  • Backtesting can be implemented to test a trader’s algorithmic strategy against historical data, in order to improve its accuracy, overall helping to minimise the potential risk.
  • Trades are executed more effectively as the computer follows instructions for the optimal buying or selling conditions, as well as timing trades to avoid price changes or slippage.
  • It is more efficient, as computers can action trades over fractions of a second, which is something that humans simply cannot do. This means that less time is spent monitoring financial markets.
  • Algorithmic trading can limit or reduce transaction costs, due to the lack of human intervention.
  • Complex mathematical calculations that would be too difficult for traders to perform themselves are done within seconds on a computer.
  • It allows traders to use multiple strategies at one time, as well as having a consistent trading plan.

Drawbacks of an algorithmic trading system

  • There is a risk that any fault with the algorithm or internet connectivity problems could lead to orders not being placed, duplicate orders being actioned, or even erroneous positions being taken.
  • It is difficult to constantly monitor the trading system as it can prove too fast-paced for human intervention, should a fault or issue occur.
  • It can lead to spikes in volatility, as these algorithms react to market conditions, potentially widening bid-ask spreads or not placing certain trades, which could ultimately harm liquidity.
  • High-frequency trading can amplify systemic risk by transmitting shocks across markets when combined with other factors. There is an argument that high-frequency algorithmic trading played a part in the Flash Crash in 2010, where the Dow Jones Industrial Average plummeted more than 1,000 points in 10 minutes.
  • Faulty algorithms can cause ripple effects across other markets, resulting in amplified losses.

How to learn algorithmic trading

Algorithmic trading can be a complex process and is mainly used by traders with a higher level of experience and knowledge. To get started, we would advise you to consult our learn to trade section. This is complete with step-by-step guides and tutorials to learn CFD trading and spread betting courses, which will help to familiarise yourself with our products. Our in-depth trading guides provide information on how to master basic and advanced strategies, in addition to learning about technical indicators and forms of analysis for your trading plan. You can also read about trade execution for our Next Generation platform, whose automated execution means that market orders get filled at the next available price.

Try our automated trading platform

Overall, algorithmic trading is a useful tool for professional traders to increase the volume of trades that they can make, while mitigating the risk of human emotion or error that negatively affects trades. It should, however, not be used as a substitute for careful manual trading, nor should any associated risks be underestimated. Algorithmic trading is also known by quantitative trading, see skills requried to become a quant trader here.

Interested in algorithmic trading online? Find out more about our automated trading platform that is popular across the global financial markets, MetaTrader 4.

Test drive our trading platform with a practice account
CMC Markets

Experience our powerful online platform with pattern recognition scanner, price alerts and module linking.

  • Fill in our short form and start trading
  • Explore our intuitive trading platform
  • Trade the markets risk-free

Disclaimer: CMC Markets is an execution-only service provider. The material (whether or not it states any opinions) is for general information purposes only, and does not take into account your personal circumstances or objectives. Nothing in this material is (or should be considered to be) financial, investment or other advice on which reliance should be placed. No opinion given in the material constitutes a recommendation by CMC Markets or the author that any particular investment, security, transaction or investment strategy is suitable for any specific person.

Live account

Access our full range of markets, trading tools and features.

Open a live account

Demo account

Try trading with virtual funds in a risk-free environment.

Open a demo account

Apply now to start trading

TOP