An Investor’s Guide to Algorithmic Trading

An Afro-American woman codes using Javascript, HTML, and back-end algorithm at her workstation.
Deagreez / Getty Images/iStockphoto

Commitment to Our Readers

GOBankingRates' editorial team is committed to bringing you unbiased reviews and information. We use data-driven methodologies to evaluate financial products and services - our reviews and ratings are not influenced by advertisers. You can read more about our editorial guidelines and our products and services review methodology.

20 Years
Helping You Live Richer

Reviewed
by Experts

Trusted by
Millions of Readers

These days, many aspects of everyone’s lives are being overtaken by algorithms — from online searches to social media accounts and even investments. You may hear terms thrown around — for example, algorithmic trading, automated trading, algo-trading or black-box trading. These terms all refer to the same thing, but what exactly is it?

Introduction to Algorithmic Trading

Algorithmic trading ispurchasing or selling stocks and other investment assets via an automated electronic order. In other words, software can be programmed with instructions to buy or sell an asset. In the same way that your social media news feed is programmed to show you more of the content that you already like to consume, your investment account can be programmed to acquire or purge assets depending on specified instructions, such as when a certain price or rolling average is reached.

Algo trading differs from manual trading in that a computer program directs the trading rather than an individual making real-time decisions. While algo trades are based on parameters selected by humans, the actual trading is performed electronically. This is important in modern financial markets because it enhances market liquidity and removes emotions from the decision-making process.

As a result, according to one estimate, algorithmic trading is responsible for 60% or more of all equity trades executed in the U.S. The same report seems to indicate that it’s on the rise, up at least 10% from the start of the COVID-19 pandemic.

How Algorithmic Trading Works

Algorithmic trading involves a lot more prep work than simple buy-and-hold investing. Here are the steps you’ll need to take:

  • Create an algorithm
  • Choose a platform
  • Enable your algorithm to make real-world trades

There’s a lot more happening behind the scenes with algorithmic trading that you’ll need to understand.

Key Components

These are the three essential terms you’ll need to know when it comes to algo trading:

  • Algorithms: Algorithms, which are at the heart of algo trading, are simply pre-programmed instructions for trading that is conducted electronically.
  • Data analysis: Data analysis involves using historical and real-time data to inform and construct trading algorithms.
  • Execution platforms: Execution platforms are software that automatically places the trades that an algorithm selects.

Process Overview

The process of algorithmic trading can be encapsulated in three basic steps:

Strategy Development

You can’t program a computer to do any type of trading unless you have a logical, thought-out plan that follows a particular strategy. For example, you’ll want to decide if you want to use a momentum strategy, arbitrage or one of countless other trading strategies. Once you’ve chosen your overall strategy, you’ll have to select and program the specific rules that the algorithm will follow to ensure it matches your investment objectives. You’ll want to select a risk management strategy and entry and exit points, as examples.

Programming and Backtesting

Once you’ve got your strategy in place, you’ll program the computer code to put it into action. Part of the process involves backtesting, which allows you to see how your algo worked in prior market environments and if you’re overlooking any fundamental flaws in the program.

Execution

This is where the rubber hits the road. Once you’ve created your algo, you’ll choose a platform and deploy your program in the real world. As it operates, you’ll want to monitor and adjust it as needed so that you achieve your desired results.

Common Algorithmic Trading Strategies

A computer can be programmed to execute nearly any type of trading strategy. Here are some of the most common.

Trend-Following Strategies

As the name suggests, trend-following strategies identify and follow market trends. For example, you might program an algo to buy a stock when it falls to its 200-day moving average and sell it when it gets too far above that technical mark. You might also create an algo that buys and sells stocks based on a momentum strategy, picking up shares when volume and price begin picking up and unloading them when the trend reverses.

Arbitrage Opportunities

Arbitrage involves exploiting the price difference of a stock or other security in different markets or at different times. For example, you might buy a security at one price on the U.S. markets and sell it at a slightly higher price simultaneously on a foreign market, pocketing the difference. This is known as spatial arbitrage.

In merger arbitrage, traders purchase shares of a company that has been announced as the target of a merger. As these target companies typically trade at a discount to their stated acquisition price until the deal is closed, traders can profit when the deal goes through.

Mean Reversion

Mean reversion is a strategy that plays on the tendency of assets to revert to their average price. If an algorithm can be programmed to identify overbought or oversold conditions, it will profit when prices revert to the mean.

Moving averages are often used in mean-reversion algorithms. Moving averages smooth out the ups and downs of a stock’s daily movements to present a long-term average price. If a stock trades far above its moving average, for example, an algorithm may sell it, waiting for it to trade back down to its long-term average price. Similarly, a stock that is far below its moving average may be oversold, triggering a buy order from a mean-reversion algorithm.

Index Fund Rebalancing

Index fund rebalancing involves adjusting portfolios to match changes in index compositions. For example, if a stock is dropped from the S&P 500, an index-fund-rebalancing algorithm will similarly sell that stock.

A well-designed algorithm may be able to anticipate which stocks may be added to or dropped from an index, triggering a buy or sell order before any announcement is made. The algorithm will then either capture the gain that typically occurs when a stock is added to an index — as portfolio managers tracking an index must similarly buy it — or avoid the loss that may come when an index component is dropped.

Getting Started With Algorithmic Trading

Learning the Basics

It can be difficult to algo trade unless you understand financial markets and securities. Since an algorithm can only execute a strategy that you’ve developed, you’ll need to know all the parameters of the investment strategy, which involves extensive knowledge of where stocks and markets have been and where they might go in the future.

Good To Know

As the old saying in the computer industry goes, “garbage in, garbage out” — if you don’t understand what you want to accomplish and how to do it, an algorithm can’t execute it.

While you don’t necessarily need to be an advanced programmer to algo trade, if you truly want to develop a custom algorithm, it can help to understand at least the basics of coding and programming languages like Python. Otherwise, you will be at the mercy of pre-written algos or the skills of a programmer you hire to implement your strategy.

Choosing the Right Tools

Sticking with the “garbage in, garbage out” mantra, you’ll have to choose the right tools and sources of information if you want to feed your algorithm the most relevant data. Reliable data feeds are critical, as information is disseminated rapidly in the market and if you want to have an edge, your algorithm will need constant, real-time access to the data that will allow it to execute its programs.

Additionally, you’ll need to select the right trading platforms and software. Not every platform is right for every algorithm. You’ll want to find the one that offers the best combination of ease of use, cost and security selection for your strategy. The best platforms offer a variety of tools to help you create and fine-tune your algorithm, such as backtesting, along with excellent customer service and various ways to customize your options.

Developing Your First Strategy

Keep it simple — that’s the best way to develop your first algo trading strategy. You’ll have to learn to walk before you can run, and trying to develop a complex algo right out of the gate may lead to frustration and bad investment results.

Start by setting clear goals and risk parameters. For example, if you’re building a momentum algorithm, install stop-losses or other forms of risk management so that your losses are limited if you’re wrong or if a trend reverses before you expect.

Before you implement your first algorithm, be sure to backtest it thoroughly so that you can understand how the program will operate in a variety of market conditions.

Risks and Challenges

Algorithmic trading has many advantages, but it doesn’t have all the answers. If it did, every trader who used an algorithm would be rich. Here are some of the risks and challenges with using algorithmic trading:

Market Volatility and Unexpected Events

No computer program, no matter how well-designed, can predict all future events or even most of them. The market sometimes seems to have a mind of its own, and anything from shifts in governmental policy to the outbreak of a war or, to cite a more recent example, a global pandemic, can wreak unexpected havoc on the market. In those cases, algo trading can sometimes get out of control, as these events are unlikely to be part of the original strategy and programming of the algo.

Overfitting Strategies To Past Data

While backtesting can help iron out some problems with an algo, it runs the risk of being “overly fitted” to past data. What this means is that you might develop an algorithm that fits well with historical data but doesn’t anticipate new variations of that data.

Technical Issues

No matter how well-written an algorithm may be, it’s still subject to common technical issues like power interruptions, software bugs, bad internet connections, and general glitches that plague all electronic systems.

Benefits of Algorithmic Trading

When properly set up, a computer program can process information much more quickly than a human can. This can dramatically improve the speed and efficiency of trading. It can also remove emotions from the decision-making process. Emotions can make humans buy stocks when they are high and sell them when they are down–the exact opposite of how profitable trades are made. This can make an impersonal computer program that relies on data only, instead of emotion, a better trader.

Computers also excel at processing large datasets, using extensive information to inform successful trades. The limited processing power of the human brain can’t handle the vast amount of data that a computer can, giving an advantage to algo trading.

Tools and Resources

You can familiarize yourself with algorithmic trading via online courses, tutorials and books. Some community colleges or other educational institutions may also offer courses in algo trading.

There are numerous platforms that you can use to implement your algo trading strategy. Some of the most popular include MetaTrader, QuantConnect, and TradingView. However, the number of platforms for algo trading only continues to grow, so you should shop around for the one that best suits your needs.

Is This What Robo Advisors Do?

Yes and no. Much like algorithmic trading, robo-advisors run on automation. With a robo-advisor, you specify the amount of time you plan or hope to spend in the market before needing the funds and choose the risk level you’re most comfortable with. From there, the software takes over, running your portfolio in an automated way. The fees associated with this type of account tend to be very reasonable since there’s no financial advisor acting as the go-between.

Algorithmic Investing: A Mixed Blessing

In some ways, investing has never been easier. Technology has disrupted the finance industry, and tools like algorithmic investing have made it easier to rebalance funds and act quickly — literally in the blink of an eye — on desirable investment opportunities. It has removed any logistical turmoil or cost associated with financial advisors and brought newfound abilities to everyday investors, including the opportunity to demo algorithmic investing without risk.

At the same time, algorithmic investing has made speed the name of the game. If the market is moving in a positive direction, then everyone stands to benefit — and quickly! If the market is experiencing a meltdown or mishap, however, the nature of algorithmic trading guarantees a response, which might be devastating. Given the increasing prevalence of algorithmic investing, only one thing is guaranteed: just like our news feeds and social media accounts, automated finance is here to stay.

Kelli Francis contributed to the reporting for this article.

Our in-house research team and on-site financial experts work together to create content that’s accurate, impartial, and up to date. We fact-check every single statistic, quote and fact using trusted primary resources to make sure the information we provide is correct. You can learn more about GOBankingRates’ processes and standards in our editorial policy.

BEFORE YOU GO

See Today's Best
Banking Offers

Looks like you're using an adblocker

Please disable your adblocker to enjoy the optimal web experience and access the quality content you appreciate from GOBankingRates.

  • AdBlock / uBlock / Brave
    1. Click the ad blocker extension icon to the right of the address bar
    2. Disable on this site
    3. Refresh the page
  • Firefox / Edge / DuckDuckGo
    1. Click on the icon to the left of the address bar
    2. Disable Tracking Protection
    3. Refresh the page
  • Ghostery
    1. Click the blue ghost icon to the right of the address bar
    2. Disable Ad-Blocking, Anti-Tracking, and Never-Consent
    3. Refresh the page