Every time you place an order in the stock exchanges there is a 50 percent chance that the other side of the order decision would be taken by a machine. In India, 50 percent of all trading decisions today are taken by machines thanks to algorithmic trading.
If there is someone who can understand the value of the time it is the high-frequency traders who search for trading opportunities in a one-millionth of a second. Trading in such a small time frame is a team effort which requires the best of statistical abilities, technology, and domain knowledge. Lack of any of these is a recipe for failure.
Kota, Rajasthan born Nitesh Khandelwal with degrees from IIT and IIM is in one such trader cum educator who successfully trades the markets supported by a team. Khandelwal was ahead of his time when he along with his friends thought of a startup in algorithmic trading, the only problem was market regulator SEBI didn't allow this form of trading in India then.
But when the permission was granted the team regrouped and progressively increased in strength to become one of the respected names in the market. Their training business under the name of Quantinsti is globally reknown with a presence in 140 countries.
In an interview with Moneycontrol Khandelwal explains the nitty-gritty of algorithmic trading and even retail traders can become algo traders.
Q: Can you walk us through your journey to algorithmic trading?
A: I come from Kota, Rajasthan where I completed my schooling . Later went on to pursue Electrical Engineering from IIT Kanpur in 2005 and post-graduation from IIM Lucknow in 2007.
Algorithmic trading was something that I was interested from my IIM Lucknow days. Along with some friends, I planned a startup in algorithmic trading but as we were working on the project we learned such trading were not yet allowed in India.
So I took up a job with ICICI Treasury where I worked for around a year and then had a stint with a proprietary desk in Mumbai where I headed a team of traders.
In 2008, SEBI allowed algo trading in India and by September 2009 we started iRageCapital which in those days was involved in Algorithmic Trading Consulting.
Though SEBI allowed algo trading in 2008, there were few brokers who were willing to invest in it thanks to the sub-prime crisis. As for us, we had the background required for algorithmic trading – experience and education.
Algorithmic trading requires expertise in statistics, technology, and financial markets. One of our founding members and colleague worked with Optiver in Amsterdam – one of the biggest High-Frequency Trading firm in the world. So collectively we had the skill set to get into space.
Initially, we offered turnkey solutions to a number of institutions in India and a few abroad. But later we decided to start our own trading rather than just consulting.
We took up membership in both the stock exchanges in India. We created our own platform and had, and still have, one of the fastest infrastructure in the market. We are competing in a market where every microsecond is a lifetime so it is important to have that kind of technology at play.
Q: Before discussing trading can you walk us through your company’s journey in Algorithmic Trading Education, where you are rubbing shoulders with the top in the world
A: One of the first things we realized when we were venturing into trading was we had to create a solid team for the smooth running of the business. We realized the need to train people. In those days people with a finance background were more easily available and interested in algorithmic trading than those with a technological background. Our requirement was for people who could understand statistics, technology, and derivatives.
We decided to start a program, ‘Executive program in Algorithmic Trading’ that taught statistics, knowledge of software and hardware and trading strategies. We took sessions over the weekend when offices and markets were closed. As we progressed and the need for algorithmic trading increased we realized that training itself can grow big.
We separated that division into Quantinsti that now offers courses offline and online and has a participant from over 140 countries and has a global pool of 20 successful practitioners in their own domain training our students. We are the biggest in the world in terms of traction and have become a global benchmark in algo trading and quant trading education.
We now have a few thousand students across the globe plus we have the highest completion rate, thanks to our persistent support staff. We have more than 100 placement partners in six countries and we offer lifelong learning for our students.
Q: Can you briefly describe algorithmic and High-frequency trading (HFT), especially in the Indian context?
A: In India, algorithmic trading has picked up in leaps and bounds. Been given permission in 2008 algo trading accounts for nearly 50 percent of all trading volume in the country. In terms or overall orders on the exchanges, it is 97 percent.
In the US, algo trading accounts for anywhere between 80-85 percent of trading but then they have been doing it for decades. In India, this form for trading is picking up with more players and traders joining in every day.
What I would like to point out here is that there is a difference between HFT and Algo trading. Algo is a broader domain, it means automating the execution of the order. HFT is a subset of algo trading. As the name suggests it is trading at a very high frequency.
To get an idea of the difference in manual and HFT consider this. Even a good dealer today can put in one order every second. A superhuman dealer can at best put in 4 orders per second. But a machine can send hundreds and thousands of orders every second.
These days machines have taken over the job of market making (providing liquidity by quoting both a buy and sell quote).
Say if we have to make the market in options, then we look at doing it in five strikes that are In-The-Money (ITM) and five strikes that are Out-f-The-Money (OTM). So that makes it 10 orders. We would be doing it in both the call and put side and for two expiries, so that is 40 orders.
Since we are making the market we would be placing both the bid and ask orders which makes 80 orders at any instance. Now even if there is a reasonable change of 5-10 ticks in the price, maybe less or maybe more, we would have to change all the orders and that too in an instance. This type of market making is not possible manually, you need to automate it.
For market making or even for arbitrage the window of opportunity is getting smaller by the day and that is why there is a need to react as fast as possible and the fight for speed.
The textbook definition of HFT would be a very high number of orders, high churn and high turnover. The holding period for a trade is a millisecond.
But we define it as how sensitive your strategy is to the latency that is being introduced. Latency is the time taken for the order to move from your system to the exchange. The latency can be because of your system, network or it can be from out of the system.
So say if your strategy can undertake a latency of say 100 milliseconds and that does not affect the performance of the of the strategy then we can call it a Low-Frequency Trading (LFT). If the trade can withstand a latency of a few 100 microseconds to few milliseconds then it is a Medium Frequency Trading (MFT). And when every microsecond (one-millionth of a second) matters, in that case, it is a High-Frequency Trading (HFT).
A lot of individual traders are using LFTs by automating their trading strategy. Automating takes care of some of the biggest reasons for failure in trading – discipline and risk management. It also offers the functionality of scaling it up, both in terms of numbers of orders to the number of stocks or markets one can trade. There will be no excuses for missing an opportunity in automated trading.
With the cost of technology coming down, thanks to cloud services offered by various companies, automated trading is likely to pick up. For the retail trader algo trading has helped narrow the bid-ask spread, but at the same time price inefficiencies are not there in the market for a long time.
Having said that, for an individual trader to graduate to HFT trading is difficult because it needs the support of a group of people to manage the infrastructure required in various aspects of trading.
Q: Is HFT trading only about intraday trading and how are the returns?
A: Any algorithmic trading house trades a number of strategies. Market making and arbitrage are a part of it. Depending on the market and volatility intraday accounts for 60-70 percent of the trading. The overnight positions are always delta neutral which means there is, theoretically speaking, no price risk.
While making markets we have use all instruments to cover the position. Managing deltas and higher order Greeks are a priority.
In arbitrage, the firm looks to capitalize form price inefficiencies between cash markets of the two exchanges, cash and futures, and options.
We also do directional trading, but these trades are open for milliseconds. Using machine learning we have developed statistical models to create short-term predictions.
As far as returns are concerned, it can be substantial but there are two issues to it.
One, this form of trading is opportunity driven and not highly scalable in terms of a number of orders per trade. For a normal fund (non-algo fund) if a strategy is running on X amount, with decent ease it can be scaled up to 10 times or 100 times. But in HFT the time window for the opportunity to exist is very small.
The second thing is one needs to spend a lot on technology and infrastructure to stay at the top.
Q: How has your team progressed in trading?
A: From the very beginning we have been HFT traders. Algorithmic trading is a very hard business. You need some competitive edge to succeed. It can either be technology, technical infrastructure, your trading team, access to funds, cost of credit, or strategy.
Whenever a firm starts trading they normally have the edge in 2 or 3 spaces and acquire the others as they grow. In our case, the edge was our technological expertise, knowledge in setting infrastructure and experience in trading. We have been building upon other aspects since then.
Q: Can you walk us through the thinking process behind selecting a strategy for algo trading?
A: Let’s consider a pair trading strategy (two stocks that either move in tandem or against each other). Say a trader has a hypothesis that Infosys and Wipro generally move in tandem. He says that they do so on the charts but now they are diverging. So the hypothesis is that in future it may converge which means it will be offering a good trading opportunity.
As a quant student, we would like to validate this hypothesis. We run a statistical test to see if they are cointegrated. If the hypothesis is tested true it would mean that there is a scope for mean reverting and the stocks would come back.
But the next question to ask is how far have they diverged. Is the diversion at 1 standard deviation or 2 or 3. This is the modeling part of the strategy where we create a strategy and test it out at the various scenario. Let’s assume we optimize it to taking a trading decision when the standard deviation is 2.5.
The next question if you want to automate the trade is, do you want to enter the trade by putting your own quote in the market or do you want to sacrifice the bid-ask spread and take the market position right away. This decision would also depend on the frequency of your trading. Since we are HFT trades where we trade for pennies we cannot sacrifice the spread. So we have to go by putting the trade at our price (quote).
Then the question is where to quote first. Should we quote in Infosys or Wipro? One way to answer that question is to look at where the spread is wider and quote it there. The other way is to look at which of the two stocks are more active so the probability of my trade getting hit is higher.
Another way can be to find which one is leading the other or which one is causing the movement in the other. This can be found out by running a statistical test and one can quote in the leader.
The difference in this form of trading and normal trading is using the power of statistics to increase the probability of success.
We generally look for strategies which have a minimum win to loss ratio of 55 to 60. But the average win to average loss has to be high.
Q: How does a part-time trader or someone interested in algorithmic trading go about it?
A: Apart from the usual courses that are offered by Quantinsti we have a self-based learning portal where you learn from the interactive experience.
It is machine enabled training where you start by writing one line of a code in python (software) by watching a 2-5 minute video on it. The program gives a customized feedback on whether you are right or wrong in your coding. It throws up head on why don’t you try another alternative and then takes you to a step by step process till you end up learning the whole strategy using python.
What we have done is created a platform called Quantra Blueshift where a minute by minute data is available for past years to back-test the strategy. The idea is to get people to learn to practice first and then to trade. These days there are some brokers who are opening up their trade engines to allow algorithmic trading.