DEFINITION of 'Algorithm'

An algorithm is set of rules for accomplishing a task in a certain number of steps. One common example is a recipe, which is an algorithm for preparing a meal. Algorithms are essential for computers to process information. As such, they have become central to the daily lives of humans, whether someone orders a book online, makes an airline reservation or uses a search engine.

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 a 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 particular trading period.


Following is an example of a simple algorithm for trading. A trader instructs 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 tell his program to buy 100 shares if the 50-day moving average of a stock rises above the 200-day moving average. Sophisticated algorithms can take into account hundreds of criteria before buying or selling securities. The reason for this is that computers are highly efficient machines for performing complex calculations very quickly.

In Computer Science

A programmer must employ five basic parts of an algorithm to create a successful program. The person must describe the problem in mathematical terms before setting up the formulas and processes that creates a result. Next, the programmer inputs the parameters that give the outcome, and then he executes the program over and over again to test it. The conclusion of the algorithm is the result given after the set of parameters goes 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. Also, programmers must test complex algorithms more thoroughly than simple ones, to ensure the right quality control.

  1. Business Logic

    Custom rules or algorithms that handle the exchange of information ...
  2. Trade Signal

    A trade signal is a trigger, based on technical indicators or ...
  3. Manual Trader

    A trader who manually enters trades into a trading system without ...
  4. Arbitrage Trading Program - ATP

    A computer program used to place simultaneous orders for stock ...
  5. Price Change

    The difference in the cost of an asset or security from one period ...
  6. SPAN Margin

    SPAN margin is a system that determines margin requirements according ...
Related Articles
  1. Trading

    The Basics Of Forex Algorithmic Trading

    Much of the growth in algorithmic trading in Forex markets over the past years has been due to algorithms automating certain processes and reducing the hours needed to conduct foreign exchange ...
  2. Trading

    How Trading Algorithms Are Created

    The steps quantitative traders, and traders using algorithms, follow in order to create their algorithms.
  3. Trading

    Basics of Algorithmic Trading: Concepts and Examples

    Algorithmic trading makes use of computers to trade on a set of predetermined instructions to generate profits more efficiently than human traders.
  4. Trading

    Using Genetic Algorithms To Forecast Financial Markets

    Genetic algorithms are unique ways to solve complex problems by harnessing the power of nature.
  5. 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.
  6. Tech

    Bitcoin Cash Set To Undergo Hard Fork

    The cryptocurrency will undergo a hard fork to enable a stable hash rate amid extreme price volatility.
  7. Trading

    The Power Of Program Trades

    Learn how programs make up a significant portion of the volume traded each day.
  8. Trading

    The Perils Of Program Trading

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

    Algorithms are Running the NVIDIA Show

    Are machines and algorithms driving NVDA shares to the upside?
  1. What are the most common periods used in creating Moving Average (MA) lines?

    Learn the most commonly selected periods used by traders and market analysts in creating moving averages to overlay as technical ... Read Answer >>
  2. 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 >>
Hot Definitions
  1. Liquidity

    Liquidity is the degree to which an asset or security can be quickly bought or sold in the market without affecting the asset's ...
  2. Federal Funds Rate

    The federal funds rate is the interest rate at which a depository institution lends funds maintained at the Federal Reserve ...
  3. Call Option

    An agreement that gives an investor the right (but not the obligation) to buy a stock, bond, commodity, or other instrument ...
  4. Standard Deviation

    A measure of the dispersion of a set of data from its mean, calculated as the square root of the variance. The more spread ...
  5. Entrepreneur

    An entrepreneur is an individual who founds and runs a small business and assumes all the risk and reward of the venture.
  6. Money Market

    The money market is a segment of the financial market in which financial instruments with high liquidity and very short maturities ...
Trading Center