Algorithmic trading in the Indian Markets

Insightful thread on Algo trading in India by Prathamesh Godbole


Algo trading is broadly of 3 types- execution, market making, directional Execution algorithms are the ones used by large traders to get the best possible price for their orders.

Instead of a trader manually putting in orders, an algorithm does the optimization of when and how to make these trades. Why do you need an algorithm at all instead of a human trader? Say you’re buying 10 lots of Nifty, you don’t need an algorithm. Just hit a market order.

You’ll get a fill. But what if you need to execute an order for 1000 lots of nifty? Exchange doesnt even let you punch in a single order of 1000 lots at one go. Moreover, if you put in a market order for hundreds of lots, you’ll impact the price drastically.

You want to buy with the least possible price impact, so you slice your order into smaller bits. There are 2 main parts of execution algos -

  1. The macro router
  2. micro router

Macro router - this is the overall algorithm that decides how to execute this order. There are several popular algos that are used

  • vwap
  • twap
  • market participation
  • iceberg

VWAP -
this is the simplest. The VWAP, or volume weighed average price, is the average price where trades happened. if 100 shares traded at rs 500, and 200 shares at 501, the vwap will be (100x500 + 200x501)/300 = 500.66.

The algorithm calculates what percentage of the volume was executed over the course of the day in each time slot of say 15minutes. Dividing the day into 25 chunks of 15mins, we get a distribution say 5% of volume in first slot, 20% in 2nd, 1% in third and so on.

The same percent of your order’s volume is executed in those time slots at the market price. So in times of high volume, you execute more, in times of low volume, you execute less. As a result, your average price over the day is close to vwap.

TWAP -
time weighed average price. As the name suggests, this executes uniformly over the course of the day. If you have 20 time slots and 200 shares, it will execute 10 shares in each. this is great for liquid stocks.

Market participation -
here, you want to be a % of the total traded volume. Say 20% at most. This means you want to trade more only when there is volume happening. If traded volume is thin, you will not execute either.

At 20%, for every 100 shares that trade, you’ll send an order for 20. Till further trades happen, dont trade. Why do this? For low volume shares, blindly executing twap or vwap will impact the price severely, so you limit yourself to be a fraction of the total volume.

Iceberg-
as the name suggests, this algorithm is like an iceberg- shows a tip above the surface but has a large quantity hidden. Typically, this will float small buy/sell limit orders at the top of the order book, and when filled, keep adding more until finished.

It may also have a limit price where it will aggressively buy till price is below limit. Once price crosses above the limit, it stops buying actively and floats a limit price at the bid. If the bid comes down, it will lower its own bid automatically.

Note: You will likely see cases where there is a bid at some price x. as soon as you put your order, someone puts an order one tick higher- its probably this algo, or a market maker

As a variant of iceberg, the algo could also keep buying directly until the limit price, without floating any order on the order book, staying hidden. you’ll see the price rise till some value repeatedly and drop then repeat.

There are many variants and customizations possible but these are broad categories. Now comes the 2nd piece- the micro router. this sits one level below the macro router that slices the parent order into chunks.

In India we have only 2 equity exchanges- NSE,BSE. In US, you have exchanges, dark pools, and a dozen others The micro router chooses the best venue to route the order from the algo. It also decides whether to use limit/market order, and what % of order qty to display 10-100%

if you want the fastest execution, exchanges give you racks for colocation- you put your servers right at the exchange for a fee. This reduces the time taken to get data and react to it by milliseconds- but against other algorithms, those few milliseconds are everything.

Normally, the data you get from your broker terminal or data vendor is a UDP data feed, with one tick per second roughly. True tick by tick data requires colocation, and could be hundreds or thousands of ticks per second.

This is impossible to distribute on standard internet and your machine lacks the capacity to handle it. If you’re doing HFT, without colo you’re out of the race.


What are your thoughts on this?

Link to the thread

9 Likes

Interesting, gives us some insights on understanding the deep, deep ocean called MARKETS…:+1:

Useful Info. Even I have faced it many times -When I placed a limit order, someone used to place an order few paisa higher/lower

you mean 5 paise ? :stuck_out_tongue_winking_eye:

With the growing technological advances, there have been various FinTech startups looking to use AI-driven algorithmic trading to help predict the stock market more accurately, William O’Neil India also boasts of having a service dedicated to helping users use algorithmic trading to make great investments in their portfolio.

AlgoSmith is an automated Stock portfolios service from William O’Neil India which provides tailored strategies to invest in based on an investor’s Risk Appetite and Growth requirements. There are 4 tested strategies backed by over 75 years of Research on Global Markets by William O’Neil and 10 years of fundamental data collected for Indian Markets.

As a methodology driven company, William O’Neil incorporates its CANSLIM technique into algorithms. CANSLIM takes into account a number of factors to make the most out of investments, including current quarterly earnings, annual earnings, new products, and services that are launched by companies listed in the open markets of the world.

Anupam Singhi, CEO of William O’Neil India believes that using technology allows us to have certain advantages over competitors and improve our services. He backs this claim by saying that having over 100 years of proprietary data, the algorithms trained are very accurately analyzed with a fine-tooth by our equity research team and data analysts.’

The 4 strategies offered keep into consideration of the risk appetite of the investor.

They are-

  1. Turtle Value

It is for investors who are looking for low-risk portfolios. It incorporates Price-to-book, Return on Equity, and various other MarketSmith India’s Proprietary Metrics as well as liquidity constraints.

  1. Turtle Growth

Turtle Growth is a moderate risk portfolio incorporating both technical and fundamental analysis of growth investment stocks.

  1. Dolphin

Dolphin is based on MarketSmith India’s flagship screen of leading growth stocks, ‘Growth50’. This is a moderate risk portfolio of growth stocks showing strong relative price strength and top-notch fundamentals. This Portfolio includes stocks from MarketSmith India’s ‘Growth50’, a high-quality list using 30+ separate screens designed by O’Neil portfolio managers that incorporate MarketSmith India’s exclusive ratings and rankings, plus other key fundamental and technical data points.

  1. Frog

ALGO FROG follows CAN SLIM, an investment strategy for growth stocks that was formulated by William O’Neil. This is a high-risk portfolio considering market timing along with advanced portfolio allocation strategies to get the best results.

To learn more about algorithmic trading and use AI-driven technology to help make you better investments, visit www.algosmith.in.

If I want exchange co-lo servers . It will cost bomb .
Can i take it on rent ? Will it increase my edge in trading ?