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. 

BREAKING DOWN 'Algorithm'

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.  

RELATED TERMS
  1. Luhn Algorithm

    An algorithm used to validate a credit card number.
  2. Matching Orders

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

    Machine learning is the idea that a computer program can adapt ...
  4. Consensus Mechanism (Cryptocurrency)

    Amid the dynamically changing status of the blockchain, a consensum ...
  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

    Forex algorithmic trading: Understanding the basics

    Learn more about algorithmic trading in forex markets, which automates certain processes and reduces the hours needed to conduct transactions.
  3. Insights

    How Algo Trading Is Worsening Stock Market Routs

    Self-driving stock market crash: computerized trading algorithms are running over individual investors.
  4. Tech

    How to Code Your Own Algo Trading Robot

    Ever wanted to become an algorithmic trader with the ability to code your own trading robot?
  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

    New Alternatives to High-Frequency Trading

    As high-frequency trading declines, traders are exploring new alternatives.
  7. Trading

    The Perils Of Program Trading

    The increasing use of program trading makes market glitches inevitable - and sometimes disastrous.
  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. Trading

    The Power of Program Trades

    Learn how programs make up a significant portion of the volume traded each day.
  10. Insights

    Amazon's Pricing Algorithm Favors Its Own Products, Says ProPublica (AMZN)

    According to ProPublica, Amazon's pricing algorithm favor its own products over those of its competitors. This could cost customers up to 20% more when they go shopping on the site.
RELATED FAQS
  1. Can catch-up contributions be matched?

    Learn about how the specific terms of your retirement savings plan dictate how and when your employer may match your catch-up ... Read Answer >>
  2. How do 50-day, 100-day and 200-day moving averages differ?

    Whether you are using the 50-day, 100-day or 200-day moving average, the method of calculation and how the moving average ... Read Answer >>
Trading Center