• What is an Algorithm?
  • What is Algorithmic Trading?
  • Types of Algorithmic Strategies
  • Advantages and Disadvantages

 

What is an Algorithm?

  • An algorithm is a detailed series of instructions for carrying out an operation or solving a problem
  • Algorithm was originally born as part of mathematics but is currently associated with computers and computer science
  • In a non-technical approach, we use algorithms in everyday tasks, such as a recipe to bake a cake or a do-it-yourself handbook
  • Similarly, computers use algorithms to list the detailed instructions of how to carry out a certain operation

Elements of an Algorithm?

  • To create an algorithm you need three main things:
  • A problem to solve or task to complete 
  • A series of clear and consecutive steps that allows you to solve this problem or complete this task
  • A method that allows you to measure the performance  and quality of the end result

What is Algorithmic Trading?

  • Algorithmic trading is also known as automated trading, black-box trading or algo-trading
  • It is a method of executing trades with the use of mathematical formulas run by powerful computers
  • It is done using pre-programmed trading instructions that accounts for variables such as time, price, and volume
  • It makes use of complex formulas, mathematical models and human oversight to buy and sell financial securities
  • Algorithmic traders often make use of high-frequency trading technology

Algorithmic Trading Example

  • Suppose a trader follows this simple trading method:
  • Buy 50 shares when the 50-day simple moving average crosses above the 200-day simple moving average
  • Sell 50 shares when the 50-day simple moving average crosses below the 200-day simple moving average
  • It is easy to write a computer program that will monitor the stock price and the moving averages and place the buy and sell orders
  • The trader no longer needs to watch the chart and put in the orders manually

Algorithmic Trading Strategies

  • Any strategy requires an identified opportunity in terms of improved earnings or cost reduction. The most commonly used strategies are:
  • Trend-following Strategies
  • Arbitrage Strategies
  • Index Fund Rebalancing
  • Volume and Time Weighted Average Price (VWAP) & (TWAP)

Trend-following Strategies

  • Trend-following strategies follow price trends using moving averages, channel breakouts, price level movements and other indicators
  • These are the easiest and simplest strategies to implement because they do not rely on predictions or price forecasts
  • Trades are initiated based on the occurrence of desired trending traits which are easy to implement through algorithmic coding
  • The previously mentioned example of the 50-day and 200-day moving averages is a simple yet very popular trend-following strategy

Arbitrage Strategies

  • Buying a dual-listed stock in one market and simultaneously selling it at a higher price in another market offers risk-free profit
  • The same operation can be replicated for stocks vs. futures contracts as price differentials do exist from time to time
  • Implementing an algorithm to identify such price differentials and place the orders allows for efficient profitable opportunities

Index Fund Rebalancing

  • An index fund is a mutual or exchange-traded fund designed to follow  preset rules so that it can track a specified basket of investments
  • Tracking can be achieved by trying to hold all the securities in the index in the same proportions as the index
  • Other methods include statistically sampling the market and holding “representative” securities only
  • Index funds rely on computer models in the decision as to which securities are purchased or sold and thus follow passive management
  • The main advantage of index funds for investors is they don’t require a lot of time to manage
  • Index funds have defined periods of rebalancing to bring their holdings to par with their respective benchmark indices
  • This creates profitable opportunities for algorithmic traders who capitalize on expected trades before the rebalancing process
  • Such trades are initiated via algorithmic trading systems for timely execution and best prices

 

Volume Weighted Average Price (VWAP)

  • VWAP strategy breaks up a large order and releases smaller chunks of the order to the market using stock-specific historical volume profiles
  • The aim is to execute the order close to the Volume Weighted Average Price

Time Weighted Average Price (TWAP)

  • TWAP strategy breaks up a large order and releases smaller chunks of the order using evenly divided time slots between a start and end time
  • The aim is to execute the order close to the average price between the start and end times, thereby minimizing market impact

Algorithmic Trading Requirements

  • Computer-programming knowledge to program the required trading strategy, hired programmers or pre-made trading software
  • Network connectivity and access to trading platforms for placing the orders
  • Access to market data feeds that will be monitored by the algorithm for signal generation
  • The ability and infrastructure to back test the system once it’s built and before it goes live on real market conditions
  • Available historical data for backtesting, depending upon the complexity of rules implemented in the algorithm

Back-Testing

  • Backtesting refers to testing a trading system on historical data to see how it would have performed during that time period
  • Today’s trading platforms have robust backtesting capabilities and traders can test their strategies without risking real money
  • Backtesting can be used to evaluate simple ideas or complex systems with a variety of inputs and triggers
  • A strategy can be coded, and then certain user defined input variables can be integrated that will allow testing for optimization
  • A MA crossover system could include inputs for the period of the averages and then tested to determine the optimal duration

Forward Testing

  • Forward performance testing provides another set of data on which to evaluate the trading strategy
  • It is a simulation of actual trading and involves applying the strategy in a live market – All trades are executed and documented for evaluation purposes
  • Many brokers provide simulated trading accounts where traders can place trades without risking real money
  • If the strategy shows positive results it may be ready to be applied on live market conditions with real money

Algorithmic Trading Advantages

  • Trades being executed at the best possible prices
  • Instant and accurate placement of trade orders
  • Multiple market conditions being simultaneously and automatically checked
  • Reduced risk of emotional and psychological errors as well as errors in order placement
  • The ability of strategy backtesting before live implementation

Algorithmic Trading Disadvantages

  • The technical sufficiency and the resources required
  • The required know-how to program in specific languages
  • The lack of control that comes with automation
  • The need of continuous testing, debugging and optimization