What is 'Algorithm'

An algorithm is set of instructions for solving a problem or accomplishing a task. One common example of an algorithm is a recipe, which consists of specific instructions for preparing a dish/meal. Every computerized device uses algorithms to perform its functions. 


Financial companies use algorithms in areas such as loan pricing, stock trading, and asset-liability management. For example, algorithmic trading, known as "algo," is used for deciding the timing, pricing, and quantity of stock orders.  Algo trading, also known as automated trading or black-box trading, uses a computer program to buy or sell securities at a pace not possible for humans. Since prices of stocks, bonds, and commodities appear in various formats online and in trading data, the process by which an algorithm digests scores of financial data becomes easy. The user of the program simply sets the parameters and gets the desired output when securities meet the trader's criteria.

Types of Algos

Several types of trading algorithms help investors decide whether to buy or sell. A mean reversion algorithm examines short-term prices over the long-term average price, and if a stock goes much higher than the average, a trader may sell it for a quick profit. Seasonality refers to the practice of traders buying and selling securities based on the time of year when markets typically rise or fall. A sentiment analysis algorithm gauges news about a stock price that could lead to higher volume for a trading period.

Algorithm Example

The following is an example of an algorithm for trading. A trader creates instructions within his automated account to sell 100 shares of a stock if the 50-day moving average goes below the 200-day moving average. Contrarily, the trader could create instructions to buy 100 shares if the 50-day moving average of a stock rises above the 200-day moving average. Sophisticated algorithms consider hundreds of criteria before buying or selling securities.  Computers quickly synthesize the automated account instructions to produce desired results.  Without computers, complex trading would be time-consuming and possibly impossible.

Algorithms in Computer Science

In computer science, a programmer must employ five basic parts of an algorithm to create a successful program. First, he/she describes the problem in mathematical terms before creating the formulas and processes that create results. Next, the programmer inputs the outcome parameters, and then he/she executes the program repeatedly to test its accuracy. The conclusion of the algorithm is the result given after the parameters go through the set of instructions in the program.

For financial algorithms, the more complex the program, the more data the software can use to make accurate assessments to buy or sell securities. Programmers test complex algorithms thoroughly to ensure the programs are without errors.  Many algorithms can be used for one problem; however, there are some that simplify the process better than others.  

  1. Luhn Algorithm

    An algorithm used to validate a credit card number.
  2. Program Trading

    Program trading uses a computer algorithms to buy and/or sell ...
  3. Matching Orders

    Matching orders is the process by which a securities exchange ...
  4. Machine Learning

    Machine learning is the idea that a computer program can adapt ...
  5. Cardano

    Cardano is a cryptocurrency and smart contracts platform.
  6. Howard-D'Antonio Strategy

    Thee Howard Antonio Strategy offers investors an algorithm for ...
Related Articles
  1. Trading

    Basics Of Algorithmic Trading

    Algorithmic trading is the process of using computers for placing trades in order to generate profits at a speed and frequency that are beyond a person’s capability.
  2. Trading

    Picking the right algorithmic trading software

    Want to enter the tech-savvy world of algorithmic trading? Here are some tips to picking the right algorithmic trading software.
  3. Investing

    How Earnings Are Jolting Stock Prices (AA, HAS)

    Earnings-related stock swings exceeding 5% have doubled over the past seven years. Some investors blame these earnings shocks on algorithms and ETFs
  4. Tech

    How Big Data Has Changed Finance

    The vast proliferation of data and increasing technological complexities continues to transform the way industries operate and compete.
  5. Insights

    Could Algo Trading Cause a Bigger Crash Than 1987?

    Computer-driven algorithmic trading, or algo trading, has increased the risk of a market meltdown.
  6. Trading

    The Perils Of Program Trading

    The increasing use of program trading makes market glitches inevitable - and sometimes disastrous.
  7. Investing

    Facebook's Fake News Created by Its Own Premise (FB)

    Facebook's own algorithm created the fake news issue the company is now trying to fix.
  8. Tech

    How Bitcoin Could Cut Fees With Better "Coin Selection"

    Bitcoin's developers are optimizing the cryptocurrency's coin selection algorithm to reduce its transaction fees and speed its network.
  9. Tech

    It's Now Cheaper to Bankrupt Crypto Networks

    According to one crypto researcher, it would take as little as $70 million for hackers to bankrupt Ethereum Classic's network.
  10. Trading

    Forex automation software for hands-free trading

    Automated forex trading software scans the market for favorable trades based on your input. Find out more about this valuable forex tool.
  1. Can retirement catch-up contributions be matched?

    Find out how the terms of your retirement savings plan dictate how and when your employer may match your catch-up contributions ... Read Answer >>
Trading Center