Algorithmic Trading

Algorithmic trading is buying or selling securities using a computer program to produce profits. This eliminates the human element from trading and basically allows the computer program to buy or sell based on the given coded instructions. The strategy that is being used can easily be coded and executed by the computer instead of a human. These instructions can be based on time, price action, liquidity, moving averages, RSI, or any other indicators.

Example:

A simple support and resistance strategy can be coded and used. If the share price approaches a support level that has been tested multiple times, then the program will buy multiple shares. Similarly, if the share price approaches a resistance level the program will decide to short or sell shares. Here is a visual of that:

Pros and Cons

Pros

1) No Human element:

Many of the time when traders look at their charts, they have preconceived biases about the direction or trend which may hinder their trades, but when we use algorithms/computer programs these biases are non-existent. Human traders are sometimes influenced by emotional or psychological factors that may detrimentally affect their trade.

2) Better Execution:

Trades are executed at better prices. The algorithm/ computer program will be able to maximize profits and place trades correctly when the candlestick is at its max. Also, the reaction time of a computer program is far better than that of a human.

3) More trades and better opportunities

The algorithm/computer program can take numerous amounts of trades. It can trade 15 times in an hour if programmed so. It also can check the charts of multiple stocks at the same time and find the best opportunity. Unlike humans who look at one chart or at most 2-3 charts and need time to decide which security to trade.

4) Backtesting

The strategy used in the algorithm/computer program can be tested with historical financial data to calculate the accuracy and even change the strategy based on performance. The performance can be analyzed even before using real time data or money.

Cons

1) Black Swan Events or Unprecedented Macroeconomic Changes

Most algorithms/computer programs will fail if they witness a black swan event or if economic data is released. For example, if the market suddenly falls due to a Federal rate hike or bad economic data, most algorithms will not be able to anticipate this and will lose money. Therefore, some human element is needed to understand the macroeconomic situation. If you have traded rate hike days or CPI report days you will understand what I am saying. Most algorithms cannot trade based on news. Let’s say a company suddenly denies to give dividends on the expected date, the stock will fall and the trading algorithm will not understand why. If it is trading that companies shares during this time, it will lose your money. When black swan events occur market condition change and so the trading strategies must change too to maintain profitability, but that rarely happens with algo trading.

2) High cost:

If you are using trading bots provided by some other company, they may have higher fees. Generally, they are fairly expensive. Also, their strategies cannot be changed or modified by the user as they are proprietary. A better alternative is to code your own strategies.

I believe the first con can be mitigated by using A.I. to read news and tweak the strategy accordingly or at least stop the algorithm from trading when big economic data is being released or when black swan events may occur. Such strategies already exist but are privately owned and are rarely accessible to the public. Once an algorithm can not only trade, based on charts but also based on news & economic data, I believe, algorithmic trading will become more popular. Using machine learning and deep learning, these algorithms will get better with every trade, even leading to them predicting black swan events.

Common Concepts:

1) Mean Reversion

This concept is based on the belief that a certain security or an asset has a long-term mean price or average price and eventually after fluctuation or volatility the price will come back to the mean price. Therefore profit can be made when the price has moved far higher or lower than the average mean price and will inevitably move back to its long-term mean price or at least back to its original trend. This is not exactly true all the time as companies can have sudden improvements or the broader market is late to acknowledge the improvement or profitability increase in the company. This can also be used for options pricing. Therefore a price range can be defined for a security and when the price fluctuates out of the defied range the algorithm will long or short the asset based on the belief that it will retrogress to its original long-term mean price. This stage is for short-term plays or only certain scenarios.

2) Trend Following Strategies

This is one of the most common strategies in trading. This strategy is based on the concept of determining the trend and its direction and following it to make profits. The trend can be determined based on moving averages, price action, breakouts, RSI, and many other indicators. For example, a trade can be placed when a golden cross pattern or Death cross pattern appears on the charts.

These are only two concepts, but there are 100s more out there. Also, many times these multiple concepts will be used together to improve accuracy.

Applications

Renaissance Technologies:

The legendary Medallion fund from Renaissance technologies used mathematical models and algorithms to trade and invest in the financial markets. The Medallion fund has returned mindboggling returns. The fund has generated an annual average return of 66% from its inception in 1988 to 2020 before fees. This shows that algorithmic trading has serious applications. The Medallion fund may also be using Quantitative Trading which is a bit different from Algorithmic Trading.

Programming your own Algorithms

Algorithmic trading and trading strategies can be implemented by people like me and you. All you have to do is learn a coding language like Python, C++, C, etc. Then you can program your strategies. You can backtest your strategy using previous historical data by importing data. You can also use the Pine editor on TradingView, which uses pinescript as the coding language, to make your own indicators. We will be talking about this in a future post.

“No one can predict the market consistently. It is all about odds, statistics, probabilities, and avoiding the risk of ruin.” 

Henri Simoes

On to the next.

-Akash Gaonkar-

The financial advice provided is for informational purposes only and should not be considered as professional financial advice. Consult with a qualified financial advisor before making any financial decisions, as individual circumstances may vary. We do not guarantee the accuracy or reliability of the information provided, and we are not liable for any financial losses incurred.

Similar Posts