Categories
Algo Trading

What are the Popular Technical Indicators Used in Algo Trading?

There is a famous quote by John J Murphy, a leading financial analyst from the US: “Technical analysis is a skill that improves with experience and study. Always be a student, and keep learning.” Today, let’s dive into the world of technical indicators and understand their role in a trader’s journey. This in-depth article explores popular technical indicators used in algo trading strategies!

What is Technical Analysis?

Before learning about technical indicators, let’s first dive into the basics of technical analysis. It’s essentially the practice of using historical price and volume data to form analysis and forecast the direction or trend of stock prices (or any other financial security/asset), which can ultimately be used to make trading decisions.

Technical analysis can be seen as the study of collective investor psychology or sentiment, closely related to behavioural finance. We humans (and maybe automated trading systems) determine prices in the stock market. The price is set at the equilibrium (a state of balance) between supply and demand at any given moment.

What are Technical Indicators?

Technical indicators are mathematical tools or calculations derived from a financial asset’s (stock, index, etc.) historical price and volume data. It is used to predict market trends or volatility. These are more advanced than price action methods as they use mathematical calculations to predict a stock’s future movement. 

Technical indicators can be primarily classified into four types:

  • Volume
  • Trend
  • Momentum
  • Volatility

Want to learn more? Click here to explore our dedicated article on technical indicators!

Why Do We Need Technical Indicators in Algo Trading?

Algo trading executes orders in the financial markets (stocks, currencies, commodities, derivatives, etc.) using automated or pre-programmed trading instructions. The ‘algorithm’ places orders based on specific rules and criteria. These criteria include price, timing, and quantity instructions. You can incorporate technical analysis and indicators into your algorithms. They offer an objective and rule-based approach to trading. Algo traders can implement such methods to manage risk before executing buy or sell orders.

You can train your algorithm to analyse data and generate signals based on asset price movements. [Typically, there are three main types of trends: uptrend, downtrend, and sideways.] These analyses show the historical behaviour of an asset and its major fluctuations. This makes processing pattern identification and trend recognition easier for the algorithms.

Traders can easily implement technical indicators using various programming languages and algo trading platforms. Most of these indicators are versatile and applicable across different markets, making them valuable for diversified algo trading strategies.

Let’s look at some popular traders’ choice of trend indicators: 

1. Moving Averages

A moving average is the average of the closing prices of a security/asset (index, stock, F&O, etc.) over a specified period. It is an indicator that helps traders determine the trend in the market and identify key levels of support and resistance.

  • There are primarily two types of moving averages: Simple Moving Averages (SMA) and Exponential Moving Averages (EMA).
  • The SMA is calculated as the mathematical average of prices over a certain period, while the EMA gives higher weightage to recent prices.
  • If the price is above the moving average, it’s an uptrend. If the price is below the moving average, it’s a downtrend. You can also combine and use two or more moving averages.
moving average - technical indicators used in algo trading | marketfeed

The chart displays a 20-period moving average based on the closing prices of the last twenty 5-minute candles. If you switch to a daily timeframe, the average will be calculated using the closing prices of the previous twenty one-day candles.

  • Bonus: Traders can use two major signals in their algo: Golden Cross and the Death Cross. Golden cross is a buy signal that is executed when the 50-day SMA crosses above the 200-day SMA. Death cross is a sell signal executed when the 50-day SMA goes below the 200-day SMA.

Here’s an Example!

Let us assume that you want to trade in ‘Reliance’ stock. You can define your algorithm rules to execute buy orders when a Golden Cross occurs and execute sell orders when a Death Cross occurs.

2. Supertrend 

A supertrend is a simple line used to indicate the market trend. This is one of the most used trend-following indicators in algo trading. It can also act as support or resistance.

  • The line changes its colour between green and red based on the price moment in the underlying security.
  • If the price is below the Supertrend line (in red), it indicates bearishness or a downtrend. On the other hand, if the price is above the Supertrend (in green), it indicates bullishness or up-trend.
  • Supertrend will tell you to initiate a position or give you the confidence to stay in the trade till the trend sustains.
  • You can use TradingView to apply Supertrend or any such indicator.
supertrend - technical indicators used in algo trading | marketfeed

When observing the above chart of Bank Nifty, we can see that the Supertrend line is green when the price is above the line and red when the price is below the line. It also recommends when to buy and sell.

Here’s an Example!

Suppose you want to trade in ‘Tata Power’ stock. You can code your trading algorithm using this indicator in such a way that it executes buy signals when the price is above the Supertrend line and generates sell signals if the price is below the Supertrend line.

3. Average Directional Index (ADX)

Traders use the ADX indicator to identify the strength of a trend, making it a valuable tool for avoiding sideways markets and improving trading decisions. During analysis, we can adjust the indicator settings based on time frames and market conditions to maximise its full potential.

Generally, traders use ADX with Directional Indicator (DI) lines for better results. This consists of three parts:

  1. ADX line: This measures the strength of the trend and it ranges from 0 to 100. The higher the value, the stronger the trend.
  1. Positive DI (+DI): This is an upward directional line that measures the strength of the upward trend.
  1. Negative DI (-DI): It is a downward directional line that measures the strength of the downtrend. 

What are ADX Values? 

ADX values help to predict trend strength:

  • Traders use directional lines to predict the upward or downward trend. When the +DI line is above the -DI line, the asset is experiencing an upward trend and vice versa.
  • While ADX is effective in avoiding sideways markets, traders need to be aware of the potential drawbacks such as missed price moves during transitioning phases.
  • Combining ADX with other indicators like RSI and MACD will give better results and ensure risk management for traders. This will help them confirm trends and avoid false signals.
  • Consider an example of HDFC stock with ADX and DI lines:
adx - technical indicators used in algo trading | marketfeed

Here’s an Example!

If you wish to trade Wipro stock. You can include this indicator with DI lines and train your algorithm to generate a buy signal when the +DI line crosses above the -DI line and ADX suggests a strong trend. It should execute a sell order when the +DI line is below the -DI line and ADX indicates a strong trend in the opposite direction.

4. Parabolic SAR:

Parabolic SAR (Stop and Reverse) is a trend strength indicator. This is also used as a trend reversal indicator. It is widely used to calculate stop-loss orders and reverse points, which helps traders identify trends and make trading decisions. It is plotted as a series of dots which help traders analyse an asset.

  • This is constructed to set trailing stop-loss points. This indicator moves with the asset price and helps traders by booking profits by adjusting the stop-loss levels as the trend progresses.
  • The dots play an important role in deciding the trend of the asset. If the dots remain below the asset price, the uptrend is constant and intact. On the other hand, if the dots are positioned above the asset’s price, it indicates a downward trend.
  • Parabolic SAR and Acceleration Factor (AF) are directly proportional to the sensitivity to price changes. The higher the AF, the indicator is more sensitive to price changes. A lower AF reduces the sensitivity.

[Acceleration factor is the parameter used to calculate SAR, determining how SAR dots adjust to changes in trends and price changes.]

  • This is also useful for figuring out potential trend reversals. This indicator gives signals for entering or exiting a trader, which will help traders manage their risks.
  • Like ADX, this will also give its best performance when combined with other indicators like Moving Averages.
  • Here is an example of Tata Steel stock with the Parabolic SAR dots indicating upward and downward trends.
parabolic SAR | marketfeed

Let’s look at an example!

Suppose you have decided to trade Infosys Ltd stock. You need to develop your algorithm such that it executes a buy order when SAR dots below the price are detected and executes sell orders when SAR dots above the price are observed. 

Expand Your Knowledge

The indicators we have mentioned above are all trend-based. Now, let’s look at some of the popular indicators that are based on volume, volatility, and momentum:

📍Bollinger Bands: A volatility indicator that provides information about market volatility and predicts price movements.

📍On-balance volume (OBV): OBV is a volume indicator which uses volume flow to predict changes in stock price.

📍Relative Strength Index (RSI): A momentum indicator that identifies when an asset/security is over-bought or oversold.

Conclusion

There is absolutely no doubt that technical indicators are powerful tools that can enhance your algo trading strategies. They provide objective, data-driven insights, momentum, and a well-defined approach to decision-making. The evolving financial market offers a wide range of indicators that traders can choose from. 

Technical analysis provides crucial inputs for algo trading systems, but it’s also important that we don’t solely rely on them. No indicator is perfect, accurate, or yields 100% results all the time. They are additional tools to reduce the probability of making losses and enhance the decision-making process of trading algorithms. Combining these indicators with other factors like fundamental analysis, market sentiment, and proper risk management in your algorithmic trading systems is essential.

Categories
Algo Trading

What is Algo Trading? History, Benefits Explained!

Algorithmic trading or algo trading has become a popular buzzword in the financial markets over the past few years. It has revolutionised the way people trade. The combination of financial knowledge and computer programs has resulted in faster and more accurate trade executions. In this article, we will help you understand what algo trading is and how it works. We will also discuss the advantages and risks of algo trading in India.

What is Algo Trading?

Algo trading is a method of executing orders in the financial markets (stocks, currencies, commodities, derivatives, etc.) using automated or pre-programmed trading instructions. The ‘algorithm’ places orders based on specific rules and criteria. These criteria include price, timing, and quantity instructions. The trading algorithm follows the instructions to identify opportunities in the market and executes orders when the conditions are satisfied.

Algo trading removes human emotions from the equation. Therefore, it helps avoid manual decision-making and human errors. 

What is an Algorithm?

An algorithm is a set of instructions/directions for solving a problem. It’s a step-by-step process that helps us solve problems or make decisions. These programs or algorithms operate faster than humans and make decisions at lightning-fast speeds. It is a seamless integration of technology and finance.

Brief History of Algo Trading

Algo trading has a rich history, dating back several decades. It gained significant momentum with advancements in technology, which allowed for faster and more complex algorithms.

It all started in the 1970s when computerised trading systems emerged in the American financial markets. In 1976, the New York Stock Exchange (NYSE) introduced an electronic trading system, which traders loved and accepted quickly.

An author named Michael Lewis played a significant role in popularising algorithmic trading. He brought it to the attention of both market traders and the public through his writings, especially when he talked about high-frequency algorithmic trading (HFT). In the US stock market and many other developed financial markets, about 60-75% of the overall trading volume is now generated through algo trading.

In 2008, algo trading got the green light from SEBI (India’s market regulator), and Direct Market Access (DMA) was introduced. DMA gives direct access to the electronic facilities and order books of the stock exchanges to execute trades. This opened the doors to high-frequency trading (HFT) in Indian stock exchanges, allowing more traders to participate actively in the market. But the real game-changer came in 2010 when large institutional brokers were permitted to co-locate their trading servers on the exchange premises. This tiny advantage of a millisecond gave them an edge over regular investors.

Click here to learn more about co-location.

How Does Algo Trading Work?

Algo trading is a complex process that involves many steps and processes. However, a basic outline of how algo trading works is given below:

1. Developing a Strategy

The first step in algo trading is to develop a trading strategy. Traders can create and develop strategies based on technical, fundamental, and quantitative analysis. Moreover, in recent times, traders have been using Artificial Intelligence (AI) and Machine Learning (ML) for sentimental and qualitative analysis. Historical patterns, indicator signals, price behaviour, etc., are also analysed to create strategies. 

2. Writing the Algorithm

Once the strategy is developed, the next step is to convert it into a form that computers understand. Data scientists or traders write algorithms or codes that translate the strategy. Programming languages such as Python, C++, and Java are used to write algorithms for algo trading.

3. Backtesting

Before deploying an algorithm in live markets, traders backtest it on historical data. This means that the trading strategy gets simulated or replicated in the past market. Backtesting is necessary to understand its performance in the past. This step is based on the technical analysis principle that “history tends to repeat itself”. 

However, past performance is never a guarantee of future performance. The backtesting provides different metrics such as the total return, average monthly return, standard deviation of returns, etc. [Here, deviation is nothing but a difference in the actual returns and the expected returns.] Traders make multiple optimisations and revisions before deploying the strategy in live markets.

4. Connectivity

An Application Programming Interface (API) establishes an online connection between a data provider and an end user. An API connects the algo trading system to a trading platform/broker. It is essential to implement an automated trading strategy. APIs enable real-time market data access and trade execution.

5. Order Execution & Risk Management

Once the algorithm is set, it’s time to wait. Algorithms continuously analyse market data according to the strategy. When the conditions in the strategy are satisfied, the system automatically executes buy or sell orders. Moreover, the algorithms also place stop-loss orders and perform position sizing based on the strategy to manage risk. 

6. Monitoring and Forward Testing

Before the final deployment, the strategy needs to be forward-tested. Forward testing is a method of evaluating the performance of a trading strategy by applying it to real-time market data. Forward testing ensures that the algorithm works as intended. It helps to understand how our system performs in real-time, on data that the strategy has never seen before. Any deviations or unexpected variations are corrected and optimised further.

7. Final Deployment

After forward testing the strategy, the final step is to deploy the strategy. In forward testing, the account will not be fully funded. Here, the account is fully funded and deployed in real markets. Additionally, the trades and strategies get monitored and revised periodically.

Basic Types of Algo Trading

  • High-Frequency Trading (HFT) – High-frequency trading (HFT) is a type of super-fast trading done by powerful computers. These computers use smart algorithms to quickly buy and sell stocks and other assets in different markets. Since they’re so fast, HFT computers can make lots of trades in just a short time. Traders who use HFT aim to make profits by taking advantage of small price changes.
  • Arbitrage Trading – Arbitrage refers to the practice of taking advantage of price differences for the same asset in different markets. This type of algo trading involves using automated computer programs to identify and exploit these price differences quickly and efficiently. To learn more about arbitrage trading, click here!

What are the Advantages of Algo Trading?

1. Speed and Efficiency

Algo trading operates at lightning-fast speeds. The computer program executes all the trades in mere seconds, enabling timely responses to market changes without delay. On the other hand, with manual trading, executing trades at such high speed and accuracy is impossible.

2. Accuracy

Algorithms can process large volumes of data and recognise patterns that human traders might often overlook. This results in more accurate trading decisions than human traders.

3. Eliminating Emotions or Bias

Algo trading eliminates emotional and psychological biases. Emotions such as fear, greed, and overconfidence can cloud judgment and lead to impulsive decisions. By relying on algorithms, traders can stick to predefined strategies without being influenced by market sentiments.

4. Backtesting and Optimization

Algo trading allows traders to backtest their strategies using historical data. Backtesting enables them to refine and optimise their algorithms for better performance. Traders can analyse an algorithm’s past performance and make necessary adjustments to enhance its effectiveness in current market conditions.

5. Diversification

Algo trading enables traders to diversify their portfolios across multiple assets and markets, reducing overall risk exposure. Automated systems can manage multiple trades simultaneously. This allows traders to spread their investments across different strategies, asset classes, and sectors/industries.

What are the Risks of Algo Trading?

Although algo trading has many advantages, it is necessary to be aware of its risks.

1. Technical Failures

Algo trading relies heavily on technology, making it vulnerable to technical glitches, connectivity issues, or system failures. Technical failures can lead to significant and irrecoverable financial losses. Even a minor technical error can disrupt trade execution, leading to missed opportunities or losses. Poor internet connections or latency delays can impact trade execution and pricing.

2. Market Volatility

Rapid and automated trades executed by algorithms may lead to market volatility. Huge volatility can lead to quick crashes and unexpected market movements. In extreme market conditions, algorithms may develop market fluctuations due to their swift response to price changes, leading to market instability.

3. Over-Optimisation

Over-optimising algorithms based on historical data can lead to poor performance in real-market conditions. While algorithms may show good results in backtests, they may not adapt well to real-world market conditions. Therefore, over-optimising strategies may lead to underperformance. 

4. Lack of Human Oversight

Relying fully on algo trading without human supervision may lead to unforeseen and unexpected outcomes. Moreover, algorithms may not account for market events or black swan events outside the scope of historical data.

5. Lack of Human Judgment

Algorithmic trading relies on mathematical models and historical data. So it does not consider the subjective and qualitative factors that can influence market movements. In this case, the lack of human judgment can be a disadvantage for traders who prefer discretionary trading.

In conclusion, algo trading has revolutionised the financial markets, introducing speed, accuracy, and efficiency in trade execution. By removing human emotions and leveraging the power of computer algorithms, traders can capitalise on market opportunities with remarkable precision. However, algo trading does come with inherent risks, making it essential for traders to exercise caution. As the landscape of financial markets continues to evolve, algo trading will undoubtedly play an increasingly vital role in shaping investment strategies and market dynamics.

Common FAQs on Algo Trading:

1. What is algo trading?

Algo Trading is a method of executing orders in the financial markets (stocks, currencies, commodities, derivatives, etc.) using automated or pre-programmed trading instructions.

2. When was algo trading introduced?

Algo trading was first introduced in the United States during the early 1970s with the arrival of electronic trading systems.

3. What are the major benefits of algo trading?

Algo trading has transformed the financial markets by introducing speed, accuracy, and efficiency in trade execution. By eliminating human emotions and harnessing the power of computer algorithms, traders can seize market opportunities with remarkable precision.

4. Can algo trading be profitable?

Yes, algo trading can be profitable – provided that you have the right skills, mindset, and resources. It needs to be executed with proper risk management and backtesting. Ensure you follow the guidelines set by regulatory authorities (SEBI).

  1. What is algo trading?

    Algo Trading is a method of executing orders in the financial markets (stocks, currencies, commodities, derivatives, etc.) using automated or pre-programmed trading instructions.

  2. When was algo trading introduced?

    Algo trading was first introduced in the United States during the early 1970s with the arrival of electronic trading systems.

  3. What are the major benefits of algo trading?

    Algo trading has transformed the financial markets by introducing speed, accuracy, and efficiency in trade execution. By eliminating human emotions and harnessing the power of computer algorithms, traders can seize market opportunities with remarkable precision.