Moneycontrol Be a Pro
Get App
Last Updated : Jan 11, 2019 07:50 PM IST | Source:

Podcast | Digging Deeper: What is algorithmic trading and how can you get into it?

In this Moneycontrol podcast, we dig deeper into how you can get into algorithmic trading, what qualifications you need to have, and what bear traps you need to be aware of.

Moneycontrol Contributor @moneycontrolcom

Rakesh Sharma

Of late, the stock market in the US has seen swings so wild, you could mistake it for Tarzan. Any tumultuous time such as we have seen on Wall Street inevitably comes with the Greek chorus of blame. Big investors come out and start blaming algorithms. The story is usually the same.

As Business Insider summarized it, and we paraphrase here, electronic trading programs feed off each other to cause an “invisible herding effect” which amplifies price moves, able to turn a minor downward trajectory into a major bloodbath, all in time it takes for you to blink an eye. This “herding effect” is one that is associated with human behavior, but it turns out, some researchers have attempted to explain even stock market behavior using the herding effect.


Considering electronic trading – robotic trading based on algorithms – makes up large swathes of the market now, some analysts are of the opinion that it’s this algorithmic trading that is at the heart of the swings we have seen in the market. Leon Cooperman, the billionaire stock picker who founded hedge fund Omega Advisors, in a chat with the Wall Street Journal said, "Electronic traders are wreaking havoc in the markets." In a research note published in December 2018, Deustche Bank Securites Chief International Economist Torsten Sløk named “30 risks to markets in 2019.”

Topping the list? Not the US-China trade tensions; not Brexit; not potential political changes in emerging economies like India and Brazil. It was “algo-driven, risk parity-driven fire sale in equities.” For every such article, you can just as easily find another that states exactly the opposite – “Don't Blame High-Frequency Traders For The Mistakes Of Dumb Traders,” claimed one Forbes piece in 2014, a claim echoed by CNBC in another piece. High-Frequency Trading is a subset of algorithmic trading, but we are getting ahead of ourselves. Said Business School at the University of Oxford is now even offering a class in algorithmic trading.

As usual, we turn to first principles – what is algorithmic trading? How does it affect you as a trader? Where is India when it comes to algorithmic trading? What is high-frequency trading? These are some of the questions we will attempt to address today. Helping us with our questions today is Nitesh Khandelwal who, in a chat with Shishir Asthana for Moneycontrol, gave us a 101 on algorithmic trading.

Khandelwal, an IIT and IIM alumnus, knows a thing or two about the fascinating world of algorithmic trading – he is one of the co-founders of QuantInsti, an algorithmic trading training institute. To unpack it all, and to hopefully make sense of a seemingly daunting concept like algorithmic trading is me Rakesh Sharma, on our Pick of the Day right here on Moneycontrol.

What is algorithmic trading?

“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,” writes Shishir Asthana. That number is as high as 70-80 percent in the US markets, according to CNBC. Further, CNBC reported that according to J.P. Morgan, "fundamental discretionary traders" accounted for only 10 percent of trading volume in stocks. This is when traders look at companies' performance and outlook before deciding whether to buy or sell the shares.

Khandelwal writing for Moneycontrol says, “Trading, as we know, basically involves the buying, selling or holding of securities. Now, when we append the word ‘Algorithmic’ to trading, we are introducing the use of algorithms into trading. An algorithm can be defined as a set of steps or rules which are followed to solve some problems.”

Sophisticated trading practices are not entirely a modern invention. As QuantInsti noted in a piece about the evolution of trading practices in the world, “The public was engaging in a variety of complex transactions, including forwards, futures, options, and bear raids, and by 1680, the techniques deployed in the Amsterdam market were as sophisticated as any we practice today.”

‘Fastest fingers first’ is not just a KBC mantra, but also one that has applied to trading ever since the beginning of the stock market. Fast information has always been excellent currency in trading – the early bird gets the worm. And I use that phrase quite literally, considering carrier pigeons were among the tools used to get information quicker by Julius Reuter, the founder of Thomson Reuters.

With a fleet of forty carrier pigeons, Reuter ensured he got the latest information from Brussels. “Every afternoon, once the Brussels Bourse had closed, or the last messages had arrived by telegraph from Paris, Reuter’s agent in Brussels copied the latest stock prices onto thin tissue paper and placed them in a small silken bag secured under the wing of carrier pigeons.

For safety, three different pigeons were normally despatched with the same message. Six or seven hours before the daily mail train arrived, the pigeons were circling over their dovecot at Geller’s house in Aachen, where a full team, consisting of Reuter and his wife, Geller and his thirteen-year-old son, Franz, caught them, extracted their messages, copied out the prices by hand and distributed them to their local circle of subscribers,” QuantInsti says in a piece on the origin of high-frequency trading.

The principle behind using carrier pigeons – access to information faster – has been satisfied now with high-speed computers. Information obtained, what next? This is where algorithmic trading comes in.

Khandelwal: “Algorithmic Trading involves building and implementing trading strategies using computer codes and programming. A trading strategy is basically a plan or a set of rules which are defined to conduct the process of buying and selling while trading in order to achieve a particular outcome like increasing profitability, better execution, etc.

“These trading strategies can be tested on historical data to evaluate how they would have performed if they were traded as per the parameters during the given time period. This process is called as Backtesting, which helps one minimise losses and maximise profits as per analysis of their performance on the historical data.”

How does it work? Let’s say a trader wants to follow some criteria for buying or selling: Buy 100 shares of Stock X when its 100-Day moving average goes above the 200-Day moving average; Sell shares of Stock X when its 100-Day moving average goes below the 200-Day moving average.

Much like you enforce criteria to sift numbers when you are working on something as basic as an Excel Sheet. Using these simple instructions, one can write a computer program, which will automatically monitor the stock price – including the moving average numbers – and place these orders when the assigned conditions are met.

Is this big in India? Yes, and it is getting bigger. About 30-50 percent of trades in India are via algorithmic trading, or simply, “algo trading.” According to the “Global Algorithmic Trading Market 2018-2022” report published by Research and Markets, the global algorithmic trading market is expected to grow at a CAGR of 10.36 percent during the period 2018-2022.

How is it different from manual trading?

Khandelwal: “Manual traders place their trades by studying the market conditions, analysing the signals and charts and creating a trading logic accordingly. Whereas, in algorithmic trading, one can place a trading logic in a machine and let the machine evaluate the opportunities based on the live market conditions and thereby take or suggest a trading decision whether to go long or short or hold the position.

“One can also automate this process of taking trading decisions based on the analysis which eliminates human emotions from the decision-making process thereby reducing the risks involved in taking emotion-based decisions.”

Simply put – it is robotic. The human factor – including that of human emotions – is done away with in algorithmic trading. The speed at which trading is done with machines at the helm is also, naturally, faster. Much much faster. Qunatisti notes, “Financial markets with fully electronic execution and similar electronic communication networks developed in the late 1980s and 1990s.

Till 1998 U.S Securities and Exchange Commission (SEC) authorized electronic exchanges paving the way for computerized High-Frequency Trading. HFT was able to execute trades 1000 times faster than a human. And since that time high-frequency trading (HFT) has become widespread. In 2011, arrived Nano trading technology.

A firm called Fixnetix developed a microchip that can execute trades in nanoseconds, which is equal to one billionth of a second. That is 0.000000001 seconds. At the introduction of high frequency trading, the execution time was in the seconds, and over the years, this has come down to milliseconds to microseconds to now even nanoseconds.

What are the different types of automated trading?

Khandelwal, in his piece for Moneycontrol, laid down the differences among these types of trading. In this introductory piece, let’s get a basic sense of what each one of these means:

Algorithmic Trading: The process of converting a trading strategy into an algorithm or computer code and executing trades in an automated way or manually.

Quantitative Trading: Quantitative trading involves using advanced mathematical and statistical computations along with quantitative analysis to devise trading strategies which can be executed manually or in an automated fashion.

Automated Trading: Automation of the overall process of order executions like buying, selling managing the positions, etc.

HFT (High-Frequency) Trading: Executing orders in an extremely short span of time and targeting minuscule profit from each trade but doing a vast number of them overall. HFT strategies are subset of algorithmic trading and need advanced technology that can react to opportunities within microseconds.

What is algorithmic trading?

As we have discussed earlier, proponents of algorithmic trading argue that computers can analyse huge amounts of data far faster than humans, and that AI also removes emotion from trading decisions. Khandelwal makes it easier by breaking it down. Here are his reasons:

  1. Speed: Due to the use of computers and technology to implement trades, the execution speed is increased tremendously which helps avoid slippage, which is the difference between the market price at the time when the order was placed and the price at which the trade actually gets executed.

  1. Increased Accuracy: As the process is taken over by the machine, it reduces the human errors caused due to the fatigue that can be caused while executing a large number of orders manually.

  1. Backtesting: One of the biggest advantages of using machines for trading is the fact that it makes things systematic, hence enabling the possibility to perform backtesting more comprehensively.

  1. Discipline: Trader’s emotions are eliminated in algorithmic trading as the decision making occurs according to the trading algorithm, bringing in a higher level of discipline in trading.

  1. Scalability: Algorithmic trading brings the ability to monitor & analyze a much larger number of stocks & portfolios as compared to an individual doing it manually.

Investopedia lists a few more reasons as to why algorithmic trading:

  • Trades executed at the best possible prices

  • Instant and accurate trade order placement (thereby high chances of execution at desired levels)

  • Trades timed correctly and instantly, to avoid significant price changes

  • Reduced transaction costs (see the implementation shortfall example below)

  • Simultaneous automated checks on multiple market conditions

  • Reduced risk of manual errors in placing the trades

  • Can be backtested, on available historical and real-time data, to see if it is a viable trading strategy

  • Reduced possibility of mistakes by human traders based on emotional and psychological factors

How to start algorithmic trading

Khandelwal again:

“If a person is an absolute beginner with minimal knowledge of Algorithmic Trading, then he should start off by building three necessary skills. First, quantitative skills, which help in building better models and trading strategies.

“Second, trading skills to incorporate the basic knowledge of the working of financial markets and what affects them. And, the financial computing skills that help in coding the trading strategies and understanding models through a quantitative framework. A combination of these skills will enable one to successfully implement Algorithmic Trading strategies.

“A person who doesn’t have adequate knowledge in this domain but wishes to build a career in algorithmic trading or start trading algorithmically, may start building his/her skills and start acquiring the financial as well as the technical knowledge required to become an Algorithmic Trader.”

What does the future hold for algorithmic trading?

Khandelwal says, “Algorithmic trading has shown exponential growth in recent decades and still continues to maintain the upward trend. Technology is playing a huge role in taking over the tasks done manually by automating them. Just as the automobile manufacturing got transformed from shop floors crowded with people to the new age shop floors that are entirely managed & operated by robots, trading in financial markets have been evolving with the rapid adoption of technology & data analytics.

“In developed markets where algorithmic trading has been there for decades, algorithmic trading already accounts for more than 80 percent of the trading volumes in leading exchanges. Indian markets, which witnessed algorithmic trading that was allowed by SEBI in 2008, today are also seeing rapid growth in the share of algorithmic trading with more than 40 percent of exchange volumes already being driven by algorithms. Technology is changing the way things are everywhere, make sure you have the power of algorithms on your side!”

Why the naysayers?

ET, in a piece last year noted, “There are risks as well. Since it is often almost completely machine driven, execution can be opaque and in addition, not having enough risk management or money management controls in place may create risks for clients. Or not spending enough time in understanding the weakness of the strategy involved in these algos may often turn trades into drift mode.”

Flash crashes are almost always attributed to algorithmic trading/high frequency trading. “On May 6th 2010, a computer driven sale worth $4.1 billion triggered the May Flash Crash, where the Dow Jones plummeted 1000 points within a single trading day. Nearly $1 trillion was wiped off the market value, as well as a drop of 600 points within a 5-minutes time frame, before recovering moments later. The SEC and CFTC largely blamed HFT firms for the crash,” noted QuantInsti.

Market structure experts, however, have constantly pushed back against this narrative. Trading news site Curatia noted, “Huge, rapid stock swings occurred well before the advent of algorithmic trading. On the whole, the electronification era remains one of the lowest-volatility periods on record despite the rise of high-frequency trading. And the recent surge in volatility doesn't correlate with any specific increase in market automation.”

There have also been seismic changes in the way the market operates. The variety in types of trading venues, both inside and outside of big banks, have resulted in “tectonic plate-like platforms in the market,” as Business Insider terms it.

This can make price discovery trickier. This phenomenon is particularly true during periods of low liquidity, or thinned out buying and selling, as is generally seen over the holiday period – and that could be one explanation for the swings we saw on Wall Street during the last couple of weeks.

Machines are, some experts feel, not to blame for this. Similarly the human-involved activity leading to volatility in the markets has been, to put it mildly, more than usual – the US-China trade war, Federal Reserve policy, seesawing of oil prices, Brexit, etc, are merely a few of the several yorkers the markets have had to face. European Principal Traders, in one analysis, noted that kneejerk blame of robots was irresponsible. Or as Curatia said it: "For all the good things about machines, arguably the best is that when you point a finger at them, they don't point back."

Everyone needs a bogeyman.

There are good algorithms, and there are bad algorithms

"There is good high-frequency trading and bad high-frequency trading," said Maureen O'Hara, a professor at Cornell’s Samuel Curtis Johnson Graduate School of Management, non-executive chairman of ITG, an independent broker and electronic trading firm, and member of the Commodity Futures Trading Commission's "Flash Crash" committee. “Where it crosses the line is where you are trying to elicit behavior using trades that are manipulations.”

Michael Lewis’s ‘Flash Boys,’ a bestseller has certainly given a bad reputation to high-frequency traders, but much of it, O’Hara and others seem to imply, is not warranted. In a recent article O’Hara wrote in the Financial Analysts Journal she asserted the same. "For the little guy, high frequency has been unambiguously good,” she said.

“While there are abuses and illegal practices among the high-frequency crowd, the advent of millisecond buying and selling by armies of computers has narrowed spreads, increased liquidity and made things better for small investors,” Forbes added on the matter.

Marco Navone and Tallis Putnins, professors of finance, University of Technology Sydney wrote for the Conversation:

“While some algorithms are harmful to institutional investors, causing higher transaction costs, others have the opposite effect. Algorithms that are harmful, as a group, increase the cost of executing large institutional orders by around 0.1 percent.

But these effects are offset by a group of traders that significantly decrease those costs by approximately the same amount. The beneficial algorithms provide liquidity to institutional investors by taking the other side of their trades.”

Does it mean that the increasing presence of algorithmic trading is decreasing the human role to the point of irrelevance? Not necessarily. Alan Reynolds, senior fellow at the Cato Institute says, “Even if it were clearer than it is that HFT expertise could regularly outperform ordinary day traders on any given day, however, that would not prove computers can beat individuals and fund managers where it matters — namely, in longer-term investment returns.

If supercomputers run by PhD finance professors could beat ordinary investors, why have quant funds performed so poorly?”

The Wall Street Journal recently noted, “a group of 65 such funds tracked by investment-research firm Morningstar Inc. lagged behind 72 percent of their category rivals, on average, in the three years ended August 27.”

The bottom line is low-frequency traders who take a second to make decisions to buy and sell in large amounts have to reconcile with the notion that a second is just too long in modern-day stock markets. The grouse that some traders may have about being outwitted by algorithmic trading must not rank above the benefits of faster pricing and speeds and higher liquidity that algo trading offers.

Clearly, there is a lot to unpack in the world of algorithmic trading, and on this inaugural episode, we hope we have given you a sense of the lay of the land. In our coming episodes, we will dig deeper into how you can get into algorithmic trading, what qualifications you need to have, and what bear traps you need to be aware of.

If this is the technology that is running in a majority of the stock markets in the developed world and is on the rise in India too, it would be foolhardy to not know it. And on Moneycontrol podcasts, our stated goal has always been to make you a smart listener, and an even smarter investor.

(With inputs from Nitesh Khandelwal)

The Great Diwali Discount!
Unlock 75% more savings this festive season. Get Moneycontrol Pro for a year for Rs 289 only.
Coupon code: DIWALI. Offer valid till 10th November, 2019 .
First Published on Jan 10, 2019 09:30 pm
Follow us on
Available On