## 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.

Next Up

## 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. ### Matching Orders

Business logic is the custom rules or algorithms that handle ...
3. ### Cardano

Cardano is a cryptocurrency and smart contracts platform.

5. ### SPAN Margin

SPAN margin is a system that determines margin requirements according ...
6. ### Search Engine

A search engine uses algorithms to filter indexed content, and ...
Related Articles

### 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.
2. 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.
3. Insights

### How Algo Trading Is Worsening Stock Market Routs

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

An in depth look at how high-frequency trading works and who the players are.
5. Investing

### Why Facebook Stock Looks Like a Bargain

Facebook stock plunged after CEO Mark Zuckerberg announced yet another change to its news feed algorithm.

### Love by the Numbers: The Math Behind Online Dating (IACI)

Behind the growing use of online dating are complex algorithms facilitating the matching process.
8. 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.

### The Power of Program Trades

Learn how programs make up a significant portion of the volume traded each day.
10. 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.
RELATED FAQS
1. ### 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 >>
2. ### Which periods are used most commonly 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 >>

Hot Definitions
1. ### Gross Margin

A company's total sales revenue minus its cost of goods sold, divided by the total sales revenue, expressed as a percentage. ...
2. ### Inflation

Inflation is the rate at which prices for goods and services is rising and the worth of currency is dropping.
3. ### Discount Rate

Discount rate is the interest rate charged to commercial banks and other depository institutions for loans received from ...
4. ### Economies of Scale

Economies of scale refer to reduced costs per unit that arise from increased total output of a product. For example, a larger ...
5. ### Quick Ratio

The quick ratio measures a company’s ability to meet its short-term obligations with its most liquid assets.
6. ### Leverage

Leverage results from using borrowed capital as a source of funding when investing to expand the firm's asset base and generate ...