What is algorithmic trading? **Algorithmic trading is the buying and selling financial assets using computers, without human intervention. It is done to exploit persistent market opportunities to make profits. **

The best way to learning algorithmic trading is to join a trading firm or find a mentor and shadow him at work. More details on this later.

## What is the Point of Algorithmic Trading?

The point of algorithmic trading is to long or short a financial asset when its price is not what (we think) it should be.

To represent that in logic form:

If X happens, Y should happen.

If Y doesn’t happen, we do Z in anticipation that Y will happen.

For instance, if satellite images of all Walmarts show an increase in the number of parked cars (which implies an increase in shoppers), the price of Walmart should rise.

If the price doesn’t rise, we buy the stock in hopes that it does (especially during the next quarterly earnings announcement).

### When should we use algorithmic trading instead of manual trading?

We use algorithmic trading when the market opportunity is persistent, which means it appears over and over in a similar fashion. We use manual trading when the market opportunity is one-off.

### Reasons to use algorithmic trading

We use algorithmic trading when:

- Analysing large amounts of data
- Analysing data quickly
- Analysing text or images (using machine learning)
- Collecting large amount of data (web scraping)
- Firing a trade with lightning quick reactions
- Firing many trades in a short time
- Firing a trade where you need a precise price
- We need to monitor the markets 24/5
- The trader is lazy

**Examples of algorithmic trading strategies**

- Asset A usually moves before asset B. We buy or short asset B when we see asset A move.
- Fire a trade quickly (using machines) before the market can react to a piece of news.
- A group of similar stocks from the same country and industry usually move together. Today, one of the stock moves in an unusual fashion. We buy or short this stock in hopes that its behaviour will revert back to normal.

**Examples of manual trading strategies**

In contrast, here are some examples of manual trading strategies.

- Hedge fund manager George Soros profiting $1 billion betting that the UK was unable to maintain the British Pound above a certain value in 1992
- Winklevoss Twins (the twins that sued Facebook’s CEO Mark Zuckerberg) became billionaires thanks to a $11 million bet on bitcoin in 2013.
- Sending someone to record the number of trucks leaving a timber processing factory every day. Thus, estimating supply and sales. This allows us to predict the timber company’s earnings.

### What are the key components of algorithmic trading?

Finance, mathematics and programming. Finance gives us the trading idea, mathematics helps us quantify the opportunity, and programming helps us test and implement the trading strategies.

Learn finance before the math. Learn the math before programming.

**Finance**

Understanding finance, economics and how the market works is the most important part of algorithmic trading. This gives us the skills to identify and find trading opportunities.

In many cases, having knowledge of other specific domains is useful if we are trading products in those industries.

For example, understanding the weather and agriculture process is useful if you are trading coffee futures.

**Mathematics**

For most trading ideas, you just need high school level statistics.

You need statistics knowledge to calculate how big or small an opportunity is, and to calculate how big your trades should be.

Let’s say a trade wins 50% of the time with a 15% return, loses 40% of the time with a 10% loss and loses 10% of the time with a 100% loss.

Is this a good opportunity? If yes, how much should we trade?

There is a statistical formula for the two questions above. Go read about Expected Value and Optimal F.

Alternatively, we can run simulations to find the optimal betting size.

**Programming**

Programming lets you test, improve and deploy your algorithmic trading strategy.

Programming is usually the last piece of the puzzle after the initial strategy design phase. However, it is increasingly important as new strategies require technical skills at the onset.

For instance, if we are evaluating comments from web forums and reviews from restaurant review sites for opportunities, we need programming skills to scrape those data.

This has to be done at the initial strategy development phase.

### Can an individual run an algorithmic trading strategy

Yes, an individual can. Software and data is cheap enough for a single person to run a algorithmic trading strategy. However, a single person can’t run a high-frequency trading strategy as the costs and technical requirements are too high.

High-frequency trading (HFT) firms spend hundreds of millions for trading infrastructure and have teams of usually very competent computer scientists, data scientists and traders.

It is more than difficult for a single person to win the HFT battle.

Note that just because a single person can run an algorithmic trading strategy, doesn’t imply he or she can be profitable in the long term.

Knowing how to play chess and being a chess champion are two very different things.

» If you want to learn how to beat chess champions (the hedge funds), check out our guide: How Can Retail Traders Beat Institutional Traders and Hedge Funds?

### How to run an algorithmic trading strategy successfully?

The best way is to join a trading firm and get mentored by experienced traders. If you are doing it alone, you need to understand what is algorithmic trading, learn how to spot opportunities, start coding and testing your ideas appropriately, deploy your strategy, make mistakes, try again, lose (hopefully small amounts) money, try again, repeat until successfully.

**What is the best way to learn algorithmic trading?**

Get into a trading firm. You’ll gain knowledge, credentials, connections, mentorship and money in one fell swoop!

Well you don’t say!

Yes, it is incredibly difficult to get into top quantitative trading firms without Masters or Ph.D. in a quantitative subject (Computational Finance, Physics, Engineering, Statistics etc). It is almost impossible if you want to get into a high-frequency trading role without these qualifications (unless your dad owns the firm!).

The good news is that there are ways to get into a decent hedge fund. Here is a list:

- Find a mentor/be an apprentice
- Work backwards from the job descriptions
- Contact those not in the HR department
- Get hired at a lower tier firm (first)
- Get your foot through the door in a related role
- Get good at trading

You can read more about those methods here: How to get a Job in Trading and How Much will I Make?

**What are some resources** to learn algorithmic reading?

**Recommended Books**

- Evaluation and Optimization of Trading Strategies – Pardo (Good insights on basic quantitative methods on building and testing trading strategies.)
- Trade your way to Financial Freedom – Van K Tharp (Ridiculous-Click bait title aside, this book is a great overview to mechanical trading systems.)
- Quantitative Trading – Ernest Chan (Introduction to basic algorithmic trading on a retail level.)
- Trading and Exchanges: Market Microstructure for Practitioners – Larry Harris (Market microstructure is the science of how financial exchanges and systems function and what actually happens when a trade is placed.)
- The Most Important Thing – Howard Marks. Mr Marks is managing over 100 billion USD in his fund, Oaktree Capital (This is not a quantitative trading book but it provides some good mental models about the markets)
- The Quants – Scott Patterson (War stories of some top quants. Good as a bedtime read. P.S. This book started me on the path of quantitative trading. Previously, I was a Buffett value investing guy.)

**Recommended ** **Readings**

- Edward Thorp Articles (Edward Thorp one of the pioneers of Quantitative Finance/Trading, I suggest reading up on all his works)
- Statistical Arbitrage – An interview with Edward Thorp (Statistical Arbitrage is one of the first quantitative strategies. It started in the 1970s)
- 4 Algorithmic Trading Strategies that Work Today
- How Can Retail Traders Beat Institutional Traders and Hedge Funds?
- Futures Trading Strategies Made Simple – A Complete Guide
- Sentiment Analysis with Python (Finance) – A Beginner’s Guide

## Related Questions

**What are the components of a trading algorithm?** A trading algorithm consists of 3 parts – 1) the code to enter a trade 2) the code to close a trade and 3) the code to calculate how much to trade.

Video lecture: Structure of a Trading Robot

**What is an example of a trading algorithm?** A common example is a moving average trading algorithm that enters a trade when a trend starts to form. This strategy rarely works in today’s market but is easy to code and hence, is a good starting point for beginners.

Video lecture: Structure and code of a moving average trading algorithm