How to learn algorithmic trading

Algorithmic Trading - Introduction to Automated Trading Using Algorithms

Algorithmic trading refers to automated trading strategies, both in terms of identifying and executing trades. The increasing use of automated trading systems fits the general trend towards automation in many industries. However, algorithmic trading is more than just a more efficient way to capture orders. The entire research and order process can benefit from automation, computing power and new technologies such as artificial intelligence.

What is algorithmic trading?

Algorithmic trading strategies follow a rule-based system for selecting investment instruments, identifying opportunities, managing risk and optimizing position size and capital employed. In most cases the systems are automated so that orders are executed by the algorithm. Terms such as systematic trading, electronic trading, black box trading, mechanical trading, and quantitative trading can sometimes be used interchangeably with algorithmic trading.

A very simple example of an algo trading system would be one that would buy a security when its 20 day moving average crosses up its 50 day moving average and sell the security when the 20 day moving average price crosses the 50 day crossed the moving average downward. The system would then execute and manage the trade. In reality, most trading systems are far more complex, but they still follow a systematic, rules-based approach.

Algo trading can be applied to any tradable asset class, but is best suited to liquid instruments that are traded on exchanges or in active interbank markets. For this reason, algo trading is rarely used in small and micro cap stocks or in illiquid bond markets. The systems can be traded in any time window, from fractions of a second to weekly or monthly periods.

How algorithmic trading works

An algo trading system requires a live price feed from an exchange and the necessary infrastructure to transmit orders to the exchange. Software is required that can read the incoming price feed, execute a trading program and place orders, as well as the hardware necessary to operate the software. In some cases, additional feeds for fundamental or market sentiment data may also be required.

A rules-based trading strategy needs to be programmed in order for it to be executed on the software. The algorithm then monitors the market to see when all the required conditions have been met. The orders are then generated automatically and transmitted to the exchange. Once a trade is executed, a message is sent back to the platform to update the position and order management tools.

Automated trading algorithms also need to manage live trades to manage risk and exit the trade once the target values ​​are met or the stop loss levels are exceeded. An important aspect of any trading system is the ability to ensure that exposure is managed and obsolete orders are reliably deleted from the market.

Who uses algorithmic trading systems?

Algorithmic trading is often associated with HFT (high-frequency trading) or high-frequency trading. Indeed, HFT is based on lightning-fast algorithms that exploit price differences between exchanges. However, the use of computer programs in the financial markets is far more common. Algo trading is finding its way into almost all areas of trading and the entire investment industry. In addition, new approaches to trading and financial management are emerging that are only possible with newer technologies.

The first automated trading systems were created by trend-following funds. These funds use a mechanical approach based only on price and end-of-day data. This enabled some of the earliest mainframe computers to be used to generate trading signals. Algo trading has come a long way since then. For many funds, the entire investment process is automated, from research to stock selection, execution and risk management.

Quantitative mutual funds make extensive use of technology to find relationships between stocks and optimize strategies. These funds combine computing power with statistical and mathematical models to maximize the risk-adjusted return and then quickly identify and execute trades.

Hedge funds are increasingly relying on automated trading to ensure that large numbers of trades can be executed quickly. Funds like Catana Capital's Data Intelligence Fund also use technology to find and leverage new data sources. The Data Intelligence Fund uses data from news and social media platforms in the form of real-time sentiment scores, thus adding another source of market intelligence to the investment process.

Banks and institutional brokers use stock trading algorithms to execute large orders with minimal market impact. Market makers also use algorithms to optimize their price setting in order to manage risk while generating profits. And options traders use algorithms to dynamically hedge positions and manage risk as the markets move.

Professional traders and day traders are also starting to use algo trading more and more. Automated trading platforms and algorithmic trading software are widely used today for retail traders and investors. Platforms like MetaTrader and NinjaTrader allow traders with very little programming knowledge to set up automated systems easily. These are especially popular in the forex market as they can be set to run around the clock.

Stock brokers like Interactive Brokers provide trading platforms that are capable of executing advanced trading algorithms that are available to a growing number of algorithmic stock traders. These platforms give traders access to markets around the world and offer margin trading, stock lending and even access to leverage.

Examples of algorithmic trading strategies

As mentioned earlier, a very basic algorithmic trading system can be based on just one or two very basic indicators. At the other end of the spectrum, the most innovative funds use information from corporate balance sheets, artificial intelligence, and big data to identify opportunities that can give them an edge. Below are examples of algorithmic trading strategies, from the simplest to the more complex systems. The common theme of the strategies is that they can all be converted into an algorithm based on a system of rules:

Trend following strategies buy stocks that are currently strong and sell stocks that are currently weaker to ensure that the portfolio is always positioned according to the current trend. These systems use moving averages or trend channels based on historical high and low prices. The aim is to capture long-term trends and at the same time minimize losses in consolidation phases.

Mean Reversion Strategies try to take advantage of the fact that prices tend to return to their average. This is especially true in times when prices are in a certain range. They are usually based on oscillators or volatility bands and moving averages. Such systems are increasingly using market sentiment to identify extremes.

Arbitrage trading strategies open long and short positions at the same time in order to benefit from temporary mispricing. Arbitrage strategies can be used when the same security is traded on different exchanges at different prices. The strategy can also be used on related securities such as different classes of stocks or convertible bonds. Sometimes when a company is listed in different countries, an arbitrage deal also involves currency trading. Automated trading is particularly good for arbitrage as it allows complex calculations to be performed to take advantage of opportunities that may be temporary.

Statistical arbitrage combines price data and fundamentals to take long and short positions in similar stocks. For example, an algorithm could open a long position in BP and a short position in Shell based on their relative valuations. Such a trade would have little impact on the market or the price of oil, but it is a bet that their relative valuations will change.

The Index arbitrage benefits from mispricing between equity and futures markets. If an index futures contract and its underlying index move too far apart, traders can make risk-free profits by taking long and short positions in the underlying stocks and the futures contract. The stock trades are carried out with an algorithm that simultaneously buys or sells all stocks in the index.

VWAP and TWAP algorithms are used by institutional traders to execute large orders. An algorithm can be used to automatically buy a certain number of stocks at VWAP (Volume Weighted Average Price) over the day. The algorithm automatically buys stocks throughout the day to bring the average price of the stocks in line with the average price of the market. TWAP (Time Weighted Average Price) is similar but uses the market price at regular intervals to calculate the average price. These algorithms can also be set to trade a certain percentage of the total market volume. These algorithms are used to limit the impact of large orders on the market.

Quantitative investment strategies use a combination of factors such as company value, growth, dividend yield or momentum to select stocks to buy or sell. While these strategies aren't always automated, more and more quant funds are automating execution.

Quantitative trading strategies can be based on any combination of price and fundamentals. Rotation strategies, for example, use a ranking list to constantly rotate capital into the best-ranked stocks and out of the worse-ranked stocks.

Index changes also offer opportunities for algo traders. The indices are rebalanced at regular intervals, which means that index funds like ETFs have to realign their holdings. Algorithms can be used to calculate the probable orders in order to benefit from the expected changes in supply and demand.

Benefits of algorithmic trading

  • Algo trading systems are usually based on empirical knowledge about the observed behavior of stocks. This is different from discretionary trading, which is very often based on theories and forecasts. Since algorithms require specific rules, they are easy to test. In contrast to this, forecasts and discretion should only be tested retrospectively.
  • Algorithmic and quantitative trading systems are able to cover a very large universe of securities. Humans can only research and monitor a limited number of markets while a conventional computer can monitor thousands of stocks. This expands the possibilities for an automated trading system and reduces costs.
  • An automated trading system can identify opportunities that match the terms of the strategy and execute trades much faster than a human trader. Chances that exist for only a fraction of a second can be seized and there is little chance that a trade will be missed.
  • Algorithmic trading is less prone to human error. This goes for doing research, identifying opportunities, calculating the correct trade size, and executing trades.

Disadvantages of algorithmic trading

While there are significant advantages to algo trading, algorithmic trading cannot be viewed without certain drawbacks and risks.

  • Systematic trading strategies do not always develop indefinitely. Once other traders build trading systems that use similar patterns or inefficiencies in the market, the benefit of one system can be undermined. In trading strategies with low margins, transaction costs can quickly exceed profits.
  • Algo trading systems are unable to adapt to changing market conditions as human traders can. A particular challenge for trading systems is knowing when to turn them off or when they may no longer be applicable at all. Loss phases are often followed by profit phases and there is always the risk that a system will be switched off shortly before a winning streak begins. On the other hand, if a system is no longer functional, it will generate more losses.
  • Large volatility peaks and flash crashes are another challenge for system traders. As volatility increases, the risk of higher spreads and large overnight gaps increases. If leverage is used, it can be fatal for a trading system. At the same time, volatility often creates the best opportunities. In addition, automated systems cannot determine when an increase in volatility was likely caused by short-term or more permanent factors.
  • Increased volatility can also cause the correlations on which some systems are based to fail. This is especially true for statistical arbitrage and similar long / short strategies.

Conclusion: Algorithmic trading has changed the financial markets

Algo trading is increasingly becoming the standard for short-term oriented traders and portfolio managers. As mentioned earlier, there are risks and disadvantages. However, as the markets become even more efficient, the chances of outperformance are smaller and the traditional approaches less viable. Algorithmic trading systems can monitor more securities and remain relevant by using smaller but more numerous options.

As in most industries today, automation is also a feature of financial markets. New technologies such as machine learning and the analysis of large amounts of data are also leading to new trading approaches, most of which are suitable for automated trading. It is therefore likely that algorithmic trading will dominate the market even more in the future.

Asset management