loader2
Partner With Us NRI

Open Free Demat Account Online with ICICIDIRECT

What are the different types of trading algorithms?

Why do traders and investors need to know different types of algorithms?

Apart from seeking knowledge for its own sake, something traders and investors are naturally good at, there are many reasons you should know the width and depth of the algo universe: 

  • You may receive a trading or investing proposal that needs evaluation 

  • You may want to write one yourself 

The main purpose of this article is to outline the lay of the land. 

Classification of Algorithms

There are many ways to classify types of algorithms, and no matter which way you slice and dice them, there will always be a considerable overlap. Here we look at the types through an end-use based scenario, and not worry about overlaps, because even where they happen their implementation would be considerably different, and at the end of the day this blog is not so much about academic correctness as it is about showing what traders and investors can think of applying.  

The bifurcation between trading and investing deserves its own blog, but for the purposes of this one it suffices to say that while investing is more about capital preservation in the short term and having a significantly positive alpha in the market over the longer term, trading is about creating as much alpha in the short term with no intention of even staying in the market over the long term. (In trading, you won't worry as much about capital preservation because you would already have sized your positions much smaller by some probability measure or another.) 

Trading

Trading algorithms need to be  

Low Latency/High Frequency - while currently closed to retail traders in India, it helps to know the scope of High Frequency Trading (HFT), to know where they have an edge in the market and, maybe, what kinds of strategies to NOT attempt when one only has access to high latency platforms. 

Market-Making :

  • Market Maker for "Vanilla" or "Underlying" securities - some firms get special appointments to maintain a base amount of liquidity in a given underlying or derivative. This means that they need to maintain both bid and ask side quotes throughout the day. The firms may be paid a certain amount by the exchange or get brokerage-free trading privileges, but their main goal is usually to achieve profits from the bid-ask spreads. 

  • Market Making for ETFs - while doing the same things as a Vanilla Market Maker, ETF Market Makers have an additional task: to maintain parity between a listed ETF and its basket constituents. This requires faster calculation of the basket changes and hitting the ETF listing with the right bid/ask quote to rebalance the ETF's price. 

  • ETF Arbitrage - concomitant on the task of ETF Market Making, there are many firms whose main aim is to outdo the ETF MMs with faster identification of arbitrage, and being in position to quickly close any open opportunities. They serve a useful purpose of both providing liquidity to the ETF in general, as well as help ETF MMs to close spreads faster. 

  • Event Arbitrage - certain market or news events create predictable volatility in the market which can be captured for short term gains. This may be caused by an impending company results or macro-economic release, or central bank actions. 

  • Statistical Arbitrage - many counters take their values from mathematical relationships with other measurable quantities or counters. For example, by their definition, Futures have a mean-reverting relationship with the underlying equities, while Options are related to their underlying via the Black Scholes equation, and Options are related to each other and the underlying equity via the Put Call Parity equation. While not traded in India, statistical arbitrage is used globally to take advantage of Interest Rate Parity relations.  

  • Latency Arbitrage - many firms have devoted themselves exclusively to optimizing their exchange connectivity, going to amazing lengths to upgrade from "low latency" and enter into "ultra-low latency" setups where they can simply stay ahead of other HFTs. This may include using microwave and fibre optic equipment. 

High Latency/Low Frequency :

  • Automation - many system traders are able to formalize their thought process to an extent that they can lay out their strategy in programmable steps. Sometimes with the help of a professional programmer, and sometimes through self-taught programming, they are able to fully automate their strategies. The currently popular Intraday Short Strangle/Straddle is an example, also known as the "9:20 Strategy". 

  • Pattern Recognition - based on shapes traced by the price chart line, or OHLC patterns, it is one of the earliest styles of manual trading. At first it was simply a sub-type of Automated Algorithms, but with the advent of pattern recognition algorithms and AI/ML which can find patterns on its own, creating a niche on its own. It is the personal opinion of this writer that Rentec's first success was with an OHLC pattern recognition algorithm based on State Space analysis, specifically the Hidden Markov Model. 

  • Technical - perhaps the most popular style of algos, these are based on technical indicators, either individually, or in some linear combination. These are straightforward to conceive, prototype, test, and deploy. Most open source backtesting packages have builtin technical indicator libraries, making this style even more tractable. 

  • Predictive/Forecasting - while technical indicators run on recent historical data, predictive algorithms attempt to forecast the future, and take positions ahead of time. With AI/ML libraries becoming ubiquitous, and easy to use, predictive algorithms are beginning to become more popular. Especially attracted to these are students, data scientists, and other such highly technical professionals who use the underlying mathematics in their daily work. All that's left to do, at that point, is to port a model, which may be predicting shopping preferences (for example), and tune it to predict stock prices or volatility or any other market indicator. 

  • Sentiment - Natural Language Processing has been developing by leaps and bounds since 1960s, and with the advent of, first, "Big Data", and then AI/ML, it became possible for traders to reliably process large amount of text. A number of data sources are now available which stream various kinds of sentiment indicators, from social media blabber to earnings calls and US Fed announcements. While earnings calls and macro news is preferred for investments (see below) social market sentiment may be used for intraday trading on volatile days. 

Investing

  • Most investment strategies will revolve around creating a portfolio from initial conditions, and then recursively "re-balancing" it based on continuously monitoring of markets and data. In adverse events, monies are usually parked in risk-free assets, and not used for short positions or withdrawn completely from the market, unlike in case of trading. 

  • Factor Based - this approach starts with Nobel Prize winning Modern Portfolio Theory, which was initially a single factor based model that measured the portfolio level impact of constituents' risk (volatility calculated from standard deviation of returns) and the and returns (the arithmetic OR geometric average returns), and re-balanced a portfolio accordingly. Over time this theory was developed to include other fundamental factors such as the Capital Assets Pricing Model (CAPM) which factored in market capitalization and book-to-market ratio in addition to portfolio risk, for a total of 3 factors (hence also called 3-factor model). Of late, certain academics and practitioners have defined more than two dozen factors! 

  • Indicator Based - technical indicators are not the sole preserve of traders: investors who want a dynamic portfolio based more on market movements than company or economic fundamentals can always use, for example, a momentum indicator to re-balance their portfolios in real time, lowering the weight of a lower momentum stock and increasing that of a higher momentum stock. 

  • Sentiment - while a continuous stream of social sentiment regarding a stock is most useful to traders, longer term sentiment can be measured from scheduled calendar events like earnings declarations, earnings calls, analyst Q&A, and on a macro-economic scale from central bank statements and releases. This information is parsed in a slightly different manner than social sentiment because, say for example, a random market analyst from Bloomberg saying good things about a company in an analyst call will be interpreted differently from a CXO on an analyst Q&A saying good things about a company. 

  • Alternative Data - broadly, any data other than financial or economic data that is used for trading and investment is defined as "alternative data". That includes everything from news (minus financial and economic data), social media, weather data and so on. In fact, in a now-famous instance, UBS tied up with a  remote sensing company to forecast Walmart financials based on occupancy of its parking lots. In another instance, IHS Markit offers a running analysis of global trade (called GTAS) by measuring, among other things, the length of waiting queues at global ports. 

Takeaways

The main purpose of this article was to give the algo traveler a lay of the land. If you are looking to get started in the journey, it's best to make a roadmap, preferably one which stays simple and within your strengths. So if you are a systems traders, automation of your strategies and copious backtesting would be suggestible. If you are a post doc in pure mathematics, perhaps you should dive straight into Hidden Markov Models? 

At the end of the day, having a learning plan, a risk plan, and putting in the hard work is what matters. 

Disclaimer: CICI Securities Ltd. (I-Sec). Registered office of I-Sec is at ICICI Securities Ltd. - ICICI Venture House, Appasaheb Marathe Marg, Prabhadevi, Mumbai - 400 025, India, Tel No : 022 - 6807 7100. I-Sec is a Member of National Stock Exchange of India Ltd (Member Code :07730), BSE Ltd (Member Code :103) and Member of Multi Commodity Exchange of India Ltd. (Member Code: 56250) and having SEBI registration no. INZ000183631. Name of the Compliance officer (broking): Ms. Mamta Shetty, Contact number: 022-40701022, E-mail address: complianceofficer@icicisecurities.com. Investments in securities markets are subject to market risks, read all the related documents carefully before investing. The contents herein above shall not be considered as an invitation or persuasion to trade or invest.  I-Sec and affiliates accept no liabilities for any loss or damage of any kind arising out of any actions taken in reliance thereon. API facilities are offered to the clients as per the terms and condition to be agreed by the client. The securities quoted are exemplary and are not recommendatory. The contents herein above are solely for informational purpose and may not be used or considered as an offer document or solicitation of offer to buy or sell or subscribe for securities or other financial instruments or any other product. Investors should consult their financial advisers whether the product is suitable for them before taking any decision. The contents herein mentioned are solely for informational and educational purpose.