Algorithmic Trading: Definition, How It Works, Pros & Cons

Algorithmic trading involves three broad areas of algorithms: execution algorithms, profit-seeking or black-box algorithms, and high-frequency trading (HFT) algorithms. While not wholly separated in real-world applications, these are all automated processes for financial trades and decision-making that use price, timing, volume, and more, along with sets of rules, to tackle trading problems that might once have required a team of financial specialists.

Key Takeaways

  • Algorithmic trading involves employing process- and rules-based computational formulas for executing trades.
  • Black-box or profit-seeking algorithms can have opaque decision-making processes that have drawn the attention and concerns of policymakers and regulators.
  • Algorithmic trading has grown significantly since the early 1980s and is used by institutional investors and large trading firms for diverse purposes.
  • While it provides advantages, such as faster execution time and reduced costs, algorithmic trading can also exacerbate the market's negative tendencies by causing flash crashes and immediate loss of liquidity.

Algorithmic trading uses complex mathematical models with human oversight to make decisions to trade securities, and HFT algorithmic trading enables firms to make tens of thousands of trades per second. Algorithmic trading can be used for, among other things, order execution, arbitrage, and trend trading strategies.

Understanding Algorithmic Trading

The use of algorithms in trading increased after computerized trading systems were introduced in American financial markets during the 1970s. In 1976, the New York Stock Exchange introduced its designated order turnaround system for routing orders from traders to specialists on the exchange floor. In the following decades, exchanges enhanced their abilities to accept electronic trading, and by 2009, upward of 60% of all trades in the U.S. were executed by computers.

Michael Lewis, the author of bestselling books on underdogs in finance, baseball, and other sectors, brought HFT algorithmic trading to the public’s attention with Flash Boys, which documented the lives of Wall Street traders and entrepreneurs who helped build the companies that came to define the structure of electronic trading in the U.S. His book showed that these companies were engaged in an arms race to build ever faster computers, which could communicate with exchanges ever more quickly, to gain an advantage over competitors with speed, using order types that benefited them to the detriment of average investors.

Image
Image by Sabrina Jiang © Investopedia 2020

Algorithmic Trading Types

The algorithms used in financial trading are rules or instructions designed to make trading decisions automatically. They range from simple single-stock to more complex black-box algorithms that analyze market conditions, price moves, and other financial data to execute trades at optimal times for the least cost-to-maximum profit ratio. The crossover of computer engineering and finance is notorious for its leaden jargon, so we won't weigh you down with too many terms here. While some phrases might change slightly from one trading firm to the next, the following should give you an idea of the wide uses for algorithmic trading:

  • Arrival price algorithms: These are designed to execute trades as close as possible to the stock price when the order was placed. These are useful for minimizing the market impact and the risk of price moves after the order is made.
  • Basket algorithms: Also called portfolio algorithms, these execute orders while calculating the effects on other decisions and securities in a portfolio. For example, even if a security is available at the right price, the algorithm may decide to hold off trading if doing so would increase risk for the portfolio as a whole. Constraints put into the algorithm include cash balancing, self-financing, and minimum and maximum participation rates.
  • Implementation shortfall algorithms: These automated rules aim to minimize implementation shortfall, the cost of executing an order when it differs from the decision price.
  • Percentage of volume: These algorithms adjust order sizes in reaction to real-time market trading volume. The purpose is to preserve a predetermined percentage of the total market volume, balancing market impact and timing.
  • Single-stock algorithms: These algorithms are designed to optimize the trade execution of a single security, considering factors like market conditions and order size.
  • Volume-weighted average price (VWAP): These algorithms execute orders at a price that closely matches the volume-weighted average price of the stock over a specific period.
  • Time-weighted average price (TWAP): These algorithms distribute trades evenly across a set period to attain an average price mirroring the time-weighted average of the stock price. They are employed to minimize market upheaval when putting in large orders.
  • Risk-aversion parameter: This will vary depending on the trader and the strategies needed, but it's often put alongside other algorithms to adjust trading aggressiveness based on the trader or client's risk tolerance.

Example of Algorithmic Trading

Let's walk through a straightforward algorithmic trading example. Suppose you've programmed an algorithm to buy 100 shares of a particular stock of Company XYZ whenever the 75-day moving average goes above the 200-day moving average. This is known as a bullish crossover in technical analysis and often indicates an upward price trend. The execution algorithm monitors these averages and automatically executes the trade when this condition is met, eliminating the need for you to watch the market continuously. This allows for precise, emotion-free trading based on specific predetermined rules, which is the essence of algorithmic trading.

Black Box Algorithms

We've separated these algorithms since they function differently than those above and are at the heart of debates over using artificial intelligence (AI) in finance. Black box algorithms are not just preset executable rules for certain strategies. The name is for a family of algorithms in trading and a host of other fields. The term black box refers to an algorithm with obscure and undisclosable internal mechanisms.

Unlike other algorithms that follow predefined execution rules (such as trading at a certain volume or price), black box algorithms are characterized by their goal-oriented approach. As complicated as the algorithms above can be, designers determine the goal and choose specific rules and algorithms to get there (trading at certain prices at certain times with a certain volume). Black box systems are different since while designers set objectives, the algorithms autonomously determine the best way to achieve them based on market conditions, outside events, etc.

Often, those using the term in the public sphere confuse two issues: there are quantified strategies that firms and others regard as trade secrets, which users know but don't share. Competitors and regulators may not understand the strategies, for example, a high-frequency trading firm might be using. However, that's because those who do within the firm aren't sharing proprietary technology.

Then, there are black box systems. A hallmark of black box algorithms, especially those employing artificial intelligence and machine learning, is another issue, namely that the decision-making processes of these systems are opaque, even to their designers. While we can measure and evaluate these algorithms' outcomes, understanding the exact processes undertaken to arrive at these outcomes has been a challenge. This lack of transparency can be a strength since it allows for sophisticated, adaptive strategies to process vast amounts of data and variables. But this can also be a weakness because the rationale behind specific decisions or trades is not always clear. Since we generally define responsibility in terms of why something was decided, this is not a minor issue regarding legal and ethical responsibility within these systems.

Thus, this obscurity raises questions about accountability and risk management within the financial world, as traders and investors might not fully grasp the basis of the algorithmic systems being used. Despite this, black box algorithms are popular in high-frequency trading and other advanced investment strategies because they can outperform more transparent and rule-based (sometimes called "linear") approaches. Such systems are at the leading edge of financial technology research as fintech firms look to take the major advances in machine learning and artificial intelligence in recent years and apply them to financial trading.

Open Source Algorithmic Trading

Just as smartphone apps and advanced AI systems have enabled non-specialists to create tailored applications and application programming interfaces (popularly known as APIs), the world of algorithmic trading has allowed outsiders to have a hand in expanding upon their proprietary work. This open-source approach permits individual traders and amateur programmers to participate in what was once the domain of specialized professionals. Hedge funds and investment firms, such as Two Sigma and PanAgora, have at times leveraged this shift by crowdsourcing algorithms and trumpeting their efforts to pay back the community of programmers by going the other way and releasing improvements to open-source applications for all to use. They also host competitions where amateur programmers can propose their trading algorithms, with the most profitable applications earning commissions or recognition.

But just as tech companies have leveraged open-access applications and programming for problem-solving and community engagement, fintech firms are increasingly going beyond just using open-access cloud computing and similar apps common all over the business world. The Fintech Open Source (FINOS) Foundation said in a November 2023 report that about a quarter of financial service professionals were involved in open-source data science and artificial intelligence/machine learning platforms. Nevertheless, there may be limits to how far this can go in the financial sector: about two-thirds of those FINOS surveyed said that they or their firms worried about using open access systems given the need to safeguard proprietary knowledge.

Advantages and Disadvantages of Algorithmic Trading

Pros and Cons of Algorithmic Trading

Pros
  • Speed: Executes trades faster than humans.

  • Accuracy: Reduces chances of manual errors.

  • Efficiency: Can trade 24/7 without fatigue.

  • Emotionless: Avoids emotional trading decisions.

  • Backtesting: Traders and researchers can test diverse scenarios outside real-world trading.

Cons
  • System Failure: Technical glitches can cause losses.

  • Over-optimization: Can lead to unrealistic results.

  • Potential liquidity issues.

  • Market Manipulation: May be used for nefarious purposes.

  • Complacency: Not adapting algorithmic system to market and regulatory changes.

Advantages

Using algorithmic trading can offer quicker and more efficient responses to market changes and events. They can also automate and ensure a closer alignment between investment decisions and trading instructions, leading to lower market impact costs and timing risks, as well as a higher rate of order completion. Here are additional advantages:

  • Anonymity: Trading is automated, with orders processed by computers and networks across platforms. This automation means that orders aren't exposed or discussed openly on the trading floor as they used to be. In addition, certain algorithms can ensure that major trades are spread out to hide major transactions, which could reveal the parties involved in smaller sectors.
  • Backtesting and research: Before use in real-world trading, algorithms can be backtested and trained on historical data to review their effectiveness, reducing the risk of potential losses. Researchers can also do this by using such systems to test hypotheses in assorted financial scenarios, increasing knowledge in the wider financial field. Many major studies have been done using such algorithmic approaches.
  • Emotionless decision-making: Algorithmic trading takes emotions and psychological factors out of decision-making in trading, potentially leading to a more disciplined approach.
  • Greater control: While this might not appear the case at first glance, given the need to turn over to automated systems various trading duties, traders can decide everything from the trading venues to specific order details like price, share quantities, and timing, and then adjust the trading pace based on a client or fund's goals and the present market conditions. Users can also modify or cancel orders almost instantly.
  • Less information leakage: Since brokers do not receive detailed information about the investor's orders or trading intentions, the risk of information leakage is reduced. Traders buying a security, for example, only need to communicate their trading needs and instructions through the selection and parameter settings of the algorithm.
  • Market access: Algorithmic trading provides quicker access to markets and exchanges via high-speed networks. In addition, clients without these high-end systems can now take advantage of benefits like co-location and low-latency connections.
  • Potential for increased transparency: While black-box algorithms have raised issues of opaque processes when the operational details for execution algorithms are shared in advance, investors know exactly how their shares will be traded in the market.
  • Precision: Algorithmic trading enables the execution of orders in highly specified conditions while reducing the probability of human error.
  • Speed and efficiency: Implicit in all the above advantages is how financial algorithms can execute orders far faster than humans, allowing traders to capitalize on market opportunities more quickly.

Disadvantages

Algorithmic trading has its limits, both for individual traders and concerning the externalities for other traders and the market as a whole:

  • Complacency: Traders may become overly reliant on familiar algorithms, using them regardless of changing market conditions.
  • Complexity: There is already the terminology that comes with the technology involved, but added to it are the extensive number of algorithms available, sometimes with uninformative names taken from film quotes or stabs at humor, which can make it overwhelming. Larger firms might work with numerous brokers, each offering a range of algorithms, adding to the complexity.
  • Compliance risks: The evolving regulatory landscape for automated trading can pose challenges requiring continuous monitoring and updates.
  • Cost: Creating and executing algorithmic trading systems is a cost that not all firms can afford, and there are also ongoing fees for networking power, hardware, and applications.
  • Historically optimized: There's a risk of creating complex algorithms that fit historical data but fail in real-market conditions.
  • Illiquidity: Another disadvantage of algorithmic trades is that it can cause liquidity to disappear quickly. Algorithmic trading was said to be a major factor in causing a loss of liquidity in currency markets after the Swiss franc discontinued its euro peg in 2015.
  • Rigidity in the face of events: Algorithms execute precisely as programmed, which can be problematic during market events they aren't designed to handle, potentially leading to inferior performance and increased costs.
  • Price discovery challenges: The shift from traditional specialists and market makers to algorithm-based trading has complicated price discovery, especially at market openings. While algorithms efficiently include price information for strategizing, they can quickly struggle to determine a security's fair market value.
  • Systemic risk: This has been widely discussed among regulators and political representatives since this kind of trading began. For example, it's feared that broadly using similar algorithms could increase systemic risk and market volatility, as seen in events like flash crashes. For example, on May 6, 2010, the Dow Jones Industrial Average, along with other indexes, had a sudden and abrupt drop, falling 1,000 points before rebounding quickly. The crash was initially triggered by a large sell order in the futures market, setting off a flurry of high-frequency trades.
  • Technological dependence: Reliance on computerized systems means glitches, connectivity issues, and system failures can lead to significant losses or missed opportunities.

How Do I Get Started in Algorithmic Trading?

To start algorithmic trading, you need to learn programming (C++, Java, and Python are commonly used), understand financial markets, and create or choose a trading strategy. Then, backtest your strategy using historical data. Once satisfied, implement it via a brokerage that supports algorithmic trading. There are also open-source platforms where traders and programmers share software and have discussions and advice for novices.

How Much Money Do I Need for Algorithmic Trading?

The amount of money needed for algorithmic trading can vary substantially depending on the strategy used, the brokerage chosen, and the markets traded.

How Is High-Frequency Trading Different From Algorithmic Trading?

HFT is actually a form of algorithmic trading, and it's characterized by extremely high speed and a large number of transactions. It uses high-speed networking and computing, along with black-box algorithms, to trade securities at very fast speeds. Trades can take place in a millionth of a second.

The Bottom Line

No doubt, algorithmic trading can offer several different advantages, such as speed, efficiency, and objectivity in trading decisions. It can automate entry and exit points, reduce the risk of human error, and prevent information leakage. However, it also carries significant risks: it's reliant on complex technology that can malfunction or be hacked, and high-frequency trading can amplify systemic risk. Market volatility, execution errors, and technical glitches are also potential hazards.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. R. Kissell. "Algorithmic Trading Methods: Applications Using Advanced Statistics, Optimization, and Machine Learning Techniques." Elsevier, 2020. Pages 23-39.

  2. Securities and Exchange Commission. "Release No. 34-59593; File No. NYSEALTR-2009-28," Page 3.

  3. Deutsche Bank Research. "High-Frequency Trading: Reaching the Limits," Page 2.

  4. Michael Lewis. "Flash Boys." W. W. Norton, 2015.

  5. R. Kissell. "Algorithmic Trading Methods: Applications Using Advanced Statistics, Optimization, and Machine Learning Techniques." Elsevier, 2020. Page 32-33.

  6. R. Kissell. "Algorithmic Trading Methods: Applications Using Advanced Statistics, Optimization, and Machine Learning Techniques." Elsevier, 2020. Page 33.

  7. E. Tsang. "AI for Finance." Taylor & Francis Group, 2023. Pages 2-11.

  8. Jarek Gryz and Marcin Rojszczak. "Black Box Algorithms and the Rights of Individuals: No Easy Solution to the 'Explainability' Problem." Internet Policy Review. (June 30, 2021.)

  9. Rola Shaway, et al. "Artificial Intelligence in Financial Services: Advantages and Disadvantages." In J. S. Hasan, et al., eds. "Artificial Intelligence for Capital Markets." CRC Press, 2023. Pages 28-39.

  10. Mahmoud El Samad, et al. "Machine Learning and Big Data in Financial Services." In J. S. Hasan, et al., eds. "Artificial Intelligence for Capital Markets." CRC Press, 2023. Pages 13-27.

  11. Two Sigma. "Open Source."

  12. Fintech Open Source Foundation. "2023: State of Open Source in Financial Services." Page 30.

  13. Bank of England. "Judgement Day: Algorithmic Trading Around the Swiss Franc Cap Removal," Pages 24-25.

Compare to Similar Robo Advisors
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.