ETFFIN Finance >> ETFFIN >  >> Financial management >> invest

Algorithmic Trading: A Comprehensive Guide

Algorithmic trading strategies involve making trading decisions based on pre-set rules that are programmed into a computer. A traderSix Essential Skills of Master TradersJust about anyone can become a trader, but to be one of the master traders takes more than investment capital and a three-piece suit. Keep in mind: there is a sea of individuals looking to join the ranks of master traders and bring home the kind of money that goes with that title. or investor writes code that executes trades on behalf of the trader or investor when certain conditions are met.

 

Algorithmic Trading: A Comprehensive Guide

 

Examples of Simple Trading Algorithms

  • Short 20 lots of GBP/USD if the GBP/USD rises above 1.2012. For every 5 pip rise in GBP/USD, cover the short by 2 lots. For every 5 pip fall in GBP/USD, increase the short position by 1 lot.
  • Buy 100,000 shares of Apple (AAPL) if the price falls below 200. For every 0.1% increase in price beyond 200, buy 1,000 shares. For every 0.1% decrease in price below 200, sell 1,000 shares.

 

Example of a Moving Average Trading Algorithm

 

Algorithmic Trading: A Comprehensive Guide

 

Moving average trading algorithms are very popular and extremely easy to implement. The algorithm buys a security (e.g., stocks) if its current market price is below its average market price over some period and sells a security if its market price is more than its average market price over some period. Here, we consider a 20-day moving average trading algorithm.

The algorithm buys shares in Apple (AAPL) if the current market price is less than the 20-day moving average and sells Apple shares if the current market price is more than the 20-day moving average. The green arrow indicates a point in time when the algorithm would’ve bought shares, and the red arrow indicates a point in time when this algorithm would’ve sold shares.

 

Advantages of Algorithmic Trading

 

1. Minimize market impact

A large trade can potentially change the market price. Such a trade is known as a distortionary trade because it distorts the market price. In order to avoid such a situation, traders usually open large positions that may move the market in steps.

For example, an investor wanting to buy one million shares in Apple might buy the shares in batches of 1,000 shares. The investor might buy 1,000 shares every five minutes for an hour and then evaluate the impact of the trade on the market price of Apple stocks. If the price remains unchanged, the investor will continue with his purchase. Such a strategy allows the investor to buy Apple shares without increasing the price. However, the strategy comes with two main drawbacks:

  • If the investor needs to pay a fixed fee for every transaction he makes, the strategy might incur significant transaction costsTransaction CostsTransaction costs are costs incurred that don’t accrue to any participant of the transaction. They are sunk costs resulting from economic trade in a market. In economics, the theory of transaction costs is based on the assumption that people are influenced by competitive self-interest..
  • The strategy takes a significant amount of time to complete. In this case, if the investor buys 1,000 shares every five minutes, it would take him just over 83 hours (more than three days) to complete the trade.

A trading algorithm can solve the problem by buying shares and instantly checking if the purchase has had any impact on the market price. It can significantly reduce both the number of transactions needed to complete the trade and also the time taken to complete the trade.

 

2. Ensures rules-based decision-making

Traders and investors often get swayed by sentiment and emotion and disregard their trading strategies. For example, in the lead-up to the 2008 Global Financial Crisis2008-2009 Global Financial CrisisThe Global Financial Crisis of 2008-2009 refers to the massive financial crisis the world faced from 2008 to 2009. The financial crisis took its toll on individuals and institutions around the globe, with millions of American being deeply impacted. Financial institutions started to sink, many were absorbed by larger entities, and the US Government was forced to offer bailouts, financial markets showed signs that a crisis was on the horizon. However, a lot of investors ignored the signs because they were caught up in the “bull market frenzy” of the mid-2000s and didn’t think that a crisis was possible. Algorithms solve the problem by ensuring that all trades adhere to a predetermined set of rules.

 

Disadvantage of Algorithmic Trading

 

1. Miss out on trades

A trading algorithm may miss out on trades because the latter doesn’t exhibit any of the signs the algorithm’s been programmed to look for. It can be mitigated to a certain extent by simply increasing the number of indicators the algorithm should look for, but such a list can never be complete.

 

More Resources

To keep learning and developing your knowledge of Algorithmic Trading, we highly recommend the additional resources below:

  • High-Frequency TradingHigh-Frequency Trading (HFT)High-frequency trading (HFT) is algorithmic trading characterized by high speed trade execution, an extremely large number of transactions,
  • Kaufman’s Adaptive Moving AverageKaufman’s Adaptive Moving Average (KAMA)Kaufman’s Adaptive Moving Average (KAMA) was developed by American quantitative financial theorist, Perry J. Kaufman, in 1998. The technique began in 1972 but Kaufman officially presented it to the public through his book, "Trading Systems and Methods." Unlike other moving averages
  • Momentum IndicatorsMomentum IndicatorsMomentum indicators are tools utilized by traders to get a better understanding of the speed or rate at which the price of a security changes. Momentum
  • Technical Analysis – A Beginner’s GuideTechnical Analysis - A Beginner's GuideTechnical analysis is a form of investment valuation that analyses past prices to predict future price action. Technical analysts believe that the collective actions of all the participants in the market accurately reflect all relevant information, and therefore, continually assign a fair market value to securities.