## Hackers Of ‘Wannacry’ Demand Bitcoins, As A Trader Why Should You Care?

It’s been a week since a ransomware called ‘Wannacry’ or ‘Wcry’ or ‘WNCRY’ is making headlines. If your computer shows nothing but this window then you’re in trouble.

More than 200k computers in 175 countries [1] have been infected by Wannacry. This malware went viral like a cat chasing dog video.

### What is ransomware?

This is a malware, a piece of code made by a group of people with not so good intentions, it takes control of your PC without your consent (of course!), then it encrypts all of your data and locks it down. Locked data can only be accessed with a key that these hackers have, so if you want to get back your data you have to pay them. Ransom is nothing new, villains in Bollywood have been doing this since ages, only this time it’s your data, not daughter.

## Why You Should Be Doing Algorithmic Trading?

‘Bots! huh? What do they know about trading? Stock market requires insights, timing and a level of genius that only humans can have’ said my friend when I asked him about his take on algorithmic trading. Could it be true? Is algorithmic trading a gimmick? Well, not quite so, in fact it’s the opposite.

84% of trades that happened in NYSE, 60% in LSE and 40% in NSE were done using algorithmic trading. From the looks of it, it seems sooner or later every trade will be done using algorithms. But why is that?

Let’s first understand, what Algorithmic trading truly is? Let’s say you have a strategy based on quantitative analysis that you developed (or stole) and it’s working well for you. Let’s assume that your strategy tells you when to buy/sell a stock and when to book profits or cut losses (this is the bare minimum a strategy should have. If yours doesn’t, boy! you’re in trouble).  So when you’re sitting at your desk sipping that Earl Grey, you’re doing either of following things at any given point –

• Looking at charts, quotes or news and trying to find a trade signal as per your strategy
• Filling in the order details when you DO find a trade signal (money time! Yay!)
• Monitoring your trades to see if they reached your target or went in opposite direction (as they often do)
• Closing positions to either book profits or cut losses
• Rinse and repeat

This is how you look while working (on an average)

Now remember, your strategy, no matter how successful on paper, is only good as long as you stick to it. To follow your strategy religiously is a vital prerequisite for making profits in the long run. That means you don’t give in to your emotions, you don’t make approximations, you don’t prematurely book profits or cancel stop losses because you think the stock will eventually move in your direction. Let’s assume you don’t do all of those things, let’s say you follow your system like a devote catholic and you are a superhuman who has mastered his emotions like a Buddhist monk (I know you’re not even close but let’s just say you are).

Even after doing all of this (getting to the superman/monk level), you’re not done yet. There are still many factors that you need to get right before you start making actual profits from your strategy. For example, you need to continuously backtest and tweak your strategy to make sure it is relevant in these ever changing markets. Having just one strategy will expose you to various risks, to mitigate that you’ll have to diversify and use at least two different strategies. And for this, you will need to keep scanning markets for new assets to trade that will fit your strategies, etcetera and etcetera.

In short, to be successful in trading (specially quantitative) you should act like a superhuman. But we both know that the truth is different, we often make mistakes, we often do things that we’re not supposed to and we end up being sad, miserable and with less net worth.

But, what if there was a way to outsource most of this heavy and depressing work, what if someone else pulled their hair and screamed over losses, what if you just stood by (sipping martinis) knowing that your strategy is being followed properly and you will eventually make money and the only work you have to do is focus on the strategy?

Let me make that martini for you, and welcome you to the world of Algorithmic Trading. Algorithmic trading is handing over the reins to a computer. You just have to write down your strategy in a language that computer would understand and let the computer do the heavy lifting for you. All the tasks that you do in a day (mentioned above) as a trader are mechanical in nature and can be done by a machine in a much better way. Computers can scan hundreds of stocks and execute as many orders in a matter of seconds (this is used in High Frequency Trading or HFT), and the setup costs for automated desks are coming down as well. The concept of letting machines do mundane tasks while we focus on higher intelligent things is a trend that is not just in trading but everywhere else. Read: self-driving cars, smart homes, siri etc.

#### Human Emotions = 0

Machines do not have emotions (at least not yet, good luck google!), we can use that to our advantage. In manual trading this is a huge detriment, fear and greed prevent us from doing what is right. Machines don’t cloud their decisions based on any external factors, they just follow what’s written in the program. When you realize that majority of trades in the market aren’t driven by emotions, it automatically puts you on a back foot making Algorithmic Trading a necessity. Your strategy truly gets a fair chance when you drop emotions out of the equation.

#### Accuracy + Speed = 100

Machines are accurate every single time when it comes to dealing with operational things in trading. For example, filling in the correct order details, I have found myself making silly mistakes in this department many times, I am pretty sure everyone has done this at least once in their trading life. Our inefficiency with respect to speed and accuracy can cost us huge opportunities. Even a skilled trader will take at least 10-15 secs to place an order, in the age of machine trading 10-15 secs is an eternity and the price can move significantly, this is true especially in terms of HFT trading. The computer will have placed and closed 100s of orders in that time frame.

#### Comfort = 1000%

Just imagine not having to go through that stressful rollercoaster of a ride every single day. This alone is more than enough reason for you to start learning Algorithmic Trading. After all, stress part wasn’t mentioned when they sold you trading as a profession, why deal with it now? Trust me it is an awesome feeling.

#### Scalability = level 100

Given the vast amount of computing power available today, we can run multiple strategies which can scan thousands of signals for trade opportunities, all at once. This is not possible for humans by any means. Heck, we humans can’t even focus on one task for long, how can we? damn you 9gag!

Having said this, let me tell you some minor but important details relating to Algorithmic Trading

### More details

Algorithm trading is the process of using computers programmed to follow a defined set of instructions for placing a trade in order to generate profits at a speed and frequency that is impossible for a human trader. There are multiple programming languages available for this purpose, some of them are R, Python, C++ etc (click here to read why Python is the most preferred language for algorithmic traders). Whichever language you choose, you do need to make sure that your algorithm is communicated properly to the computer and covers all possible events that a market can throw. Otherwise, your computer will behave like a loose cannon. The damages in such situation can be substantial.

If you are interested in setting-up your own algo trading desk, this post will guide you through the entire set of requirements ‘Setting-Up an Algo Trading Desk’. In short, you’d need a working strategy, trading software that allows automated programs to run, programming skills to code your strategy and historical data for testing, this is apart from usual trading things like broker, licenses etc.

### Next Step

Algorithmic trading is the future, the only question is when do you get on board?

If you want to learn various aspects of Algorithmic trading then check out the Executive Programme in Algorithmic Trading (EPAT™). The course covers training modules like Statistics & Econometrics, Financial Computing & Technology, and Algorithmic & Quantitative Trading. EPAT™ equips you with the required skill sets to build a promising career in algorithmic trading. Enroll now!

## An Introduction to Machine Learning with Quantiacs

Machine Learning and Artificial Intelligence are hot topics with respect to quantitative finance. The world’s largest fund company (Blackrock) recently announced that it was replacing some of their analysts with computers employing machine learn and artificial intelligence. The founder and CEO of Blackrock, Laurence Fink, says, “The democratization of information has made it much harder for active management. We have to change the ecosystem — that means relying more on big data, artificial intelligence, factors and models within quant and traditional investment strategies.”

The firm believes that the right machine learning algorithms could pick stocks as well traditional analysts. At Quantiacs, we share this belief, which is why we are on a mission to democratize hedge funds for good by empowering anyone in the world to earn a fortune creating trading algorithms in their spare time.

This post provides a brief introduction to machine learning and shows how to use the Quantiacs toolkit to create and test trading strategies.

### The Machine Learning Process

There are many types ML algorithms, and some of the higher-level problems they are used to solve include: regression, classification, and prediction.  The open source movement has provided many free ML tools, and I have found Python to be a great language to use with these ML libraries because of the number of the open source packages available and support of scientific computing.

## Can I Be A Quant In My 40s?

There was a time when you chose a career in your teens and it was supposed to stick with you for a lifetime. The constant change in technology and introduction of new career fields not only demands us to be knowledgeable about the new skill set requirements but also opens multiple new opportunities for us.

Globalization has proved to be a boon for developing nations, providing a platform for MNCs to enter new markets and lay the structure for modern day infrastructure and offering new opportunities, this move was welcomed by the masses of the developing nations.

The introduction of algorithmic trading led to the rise of a new breed of traders who are not shy when it comes to adopting new means of technology to make automated trading possible for them.

Now, to answer the question if you can be a quant in your 40s and succeed in a new domain so late in your career, the answer is a big YES. You can definitely be a quant in your 40s provided you are loaded with the zeal for automated trading with the required set of skill sets.

## Trading Using Machine Learning In Python Part-1

### Introduction

Machine Learning has many advantages. It is the hot topic right now. For a trader or a fund manager, the pertinent question is “How can I apply this new tool to generate more alpha?”. I will explore one such model that answers this question in a series of blogs.

This blog has been divided into the following segments:

• Getting the data and making it usable.
• Creating Hyper-parameters.
• Splitting the data into test and train sets.
• Getting the best-fit parameters to create a new function.
• Making the predictions and checking the performance.
• Finally, some food for thought.

### Pre-requisites

You may add one line to install the packages “pip install numpy pandas …”
You can install the necessary packages using the following code, in the Anaconda Prompt.

## Overcome the Fear of Programming

You say you never programmed in life before? Never heard of words like Classes and Objects, Dataframe, Methods, Inheritance, Loops? Are you fearful of programming, huh?

Don’t be! Programming can be fun, stimulating, and once you start and learn to program many of you would love spending hours programming different strategies; you would love to see your own codes run in the blink of an eye and would see how powerful these codes can be.

The Executive Programme in Algorithmic Trading (EPAT™) course makes extensive use of Python and R programming language to teach strategies, backtesting, and their optimization. Let us take the help of R to demonstrate how you can overcome the fear of programming. Here are some suggestions for the newbie programmers.

### 1) Think and let the questions pop in your mind

As a newbie programmer when you have a task to code, even before you start on it, spend some time ideating on how you would like to solve it step-by-step. Simply let questions pop up in your mind, as many questions as your mind may throw up.

Here are a few questions:
How to delete a column in R? How to compute an exponential moving average (EMA)?
How do I draw a line chart in R? How to merge two data sets?
Is it possible to save the results in an excel workbook using R?

Use google search to see whether solutions exist for the questions that you have raised. Let us take the second question, how to delete a column in R? We posted the question in the google search, and as we can see from the screenshot below we have the solution in the very first result shown by google.

R is an open-source project, and there are hundreds of articles, blogs, forums, tutorials, Youtube videos on the net and books which will help you overcome the fear of programming and transition you from a beginner to an intermediate level, and eventually to an expert if you aspire to.

The chart below shows the number of questions/threads posted by newbie and expert programmers on two popular websites. As you can see, R clearly tops the results with more than 10 thousand questions/threads.
(Source: www.r4stats.com )

Let us search in google whether QuantInsti™ has put up any programming material on R.
As you can see from the google results, QuantInsti™ has posted quality content on its website to help newbie programmers design and model quantitative trading strategies in R. You can read all the rich content posted regularly by QuantInsti™ here – https://www.quantinsti.com/blog

### 3) Use the print command in R

As a newbie programmer, don’t get intimidated when you come across complex looking codes on the internet. If you are unable to figure out what exactly the code does, just copy the code in R. You can use a simple “print” command to help understand the code’s working.

One can also use Ctrl+Enter to execute the code line-by-line and see the results in the console.

Let us take an example of an MACD trading strategy posted on QuantInsti’s blog.

An example of a trading strategy coded using Quantmod Package in R

I am unsure of the working of commands at line 9 and line 11. So I simply inserted a print(head(returns)) command at line 10 and one more at line 12. Thereafter I ran the code. Below is the result as shown in the console window of R.

The returns = returns[‘2008-06-02/2015-09-22’] command simply trims the original NSEI.Close price returns series. The series was earlier starting from 2007-09-17. The series now starts from 2008-06-02 and ends at 2015-09-22.

### 4) Use help() and example() functions in R

One can also make use of the help() and example() functions in R to understand a code, and also learn new ways of coding. Continuing with the code above, I am unsure what the ROC function does at line 9 in the code.

I used the help(“ROC”) command, and R displays all the relevant information regarding the usage, arguments of the ROC function.

There are hundreds of add-on packages in R which makes programming easy and yet powerful.

Below is the link to view all the available packages in R:
https://cran.r-project.org/web/packages/available_packages_by_name.html

### 5) Give time to programming

Programming can be a very rewarding experience, and we expect that you devote some time towards learning and honing your programming skills. Below is a word cloud of some essential characteristics a good programmer should possess. The best suggestion would be to just start programming!!

### Next Step

If you want to learn various aspects of Algorithmic trading then check out the Executive Programme in Algorithmic Trading (EPAT™). The course covers training modules like Statistics & Econometrics, Financial Computing & Technology, and Algorithmic & Quantitative Trading. EPAT™ equips you with the required skill sets to be a successful trader. Enroll now!

As a newbie programmer, you have just made a start. The faculty at QuantInsti™ will teach and guide you through different aspects of programming in R and Python. Over the course of the program, you will learn different data structures, classes and objects, functions, and many other aspects which will enable you to program algorithmic trading strategies in the most efficient and powerful way.

## Sentiment Trading Indicators and Strategy – Part 2

By Jay Maniar

In our last post on the sentiment indicators, we saw how we can use sentiment indicators like Put/Call ratio, Arms Index or Short term trading Index (TRIN) for trading and formulate a strategy around such sentiment indicators. In this post, we will explore more such sentiment indicators and illustrate different strategies that can be devised using these indicators.

### Volatility Index

VIX is a trademarked ticker symbol for the Chicago Board Options Exchange (CBOE) Volatility Index. It is a measure of the implied volatility over the next 30 days, of the S&P 500 index options.

#### VIX as an Indicator

• CBOE Volatility Index (VIX) is an up-to-the-minute market estimate of implied volatility of the S&P 500 Index which is calculated by taking the midpoints of the bid/ask quotes (price of options) of real-time S&P 500 index options.
• At each tick in the VIX volatility index, it provides an instantaneous measure of how much the market would fluctuate in 30 days from the last tick.
• Hence, the volatility index is forward looking and predicts the volatility of the market in future.
• VIX is quoted as percentage points, i.e. a VIX of 20 represents an expected annualized change of 20% in either direction of the S&P 500 index, at a 68% confidence level or within one standard deviation of the normal probability distribution.
• The generalized formula for calculation for VIX is

#### VIX Interpretation

• Practically, a high VIX corresponds to falling prices of the index level.
• Before understanding the reason for this, it is important to understand the basics of Option Pricing.
Option Price = Intrinsic value + Extrinsic value; where extrinsic value is the summation of time value and volatility. Hence, volatility plays an important role in the pricing of the options.
• A fall in the market typically results in higher premiums of the put options due to volatility. Also, demand for Put options among investors is high since the investors who are holding the stock would like an insurance of their stock investments by buying these put options. This demand is due to further anticipation that market would fall after a realized fall in market since the risk is high due to volatility. Volatility in the market is due to fall in prices and fear among investors of losing invested or gained capital. As a result, they might decide to take gains or realized losses by selling of underlying. This increases the premiums of options resulting in a sharp rise in VIX.
• Generally, a VIX value above 30 is an indication of high uncertainty and fear in the market.
• A low VIX value indicates an expectation of a calm market as a result of the rally seen in the market.
• A rally increases greed among investors and they expect the market to continuously rise. As a result, option writers price their call options with different strike prices in such a way that it is lucrative enough for an investor to buy the option, but the probability of the option being in the money before expiry is not too high. In a rally, more call options are bought, decreasing the (Put/Call Ratio) PCR ratio – indicating a bullish market. Investors may not want to realize all their gains at once at a particular price level, as they expect the market to rise further and sell only a fraction of the portfolio systematically to new buyers who want to enter this rally and hold onto the other part of their portfolio. There can be steady rallies and small corrections in overpriced stocks which reduce the overall volatility.
• This, in turn, drives the VIX value lower. VIX below 20 is generally an indication of a calm market.

#### Strategy

We will take contrarian positions based on VIX. Taking a contrarian position refers to ‘buying’ when the market falls drastically and ‘selling’ when the market rises irrationally. A contrarian profits from the theory that when there is certain positive or negative crowd behavior regarding a security; it leads to mispricing of the security due to the prevailing bullish or bearish sentiment.

• When VIX is high (generally above 30) we buy the underlying index. Since this is an indication that the market is bearish and the implied volatility is high, we BUY since we expect corrections in the bear market from this level and expect implied volatility to move back to its mean indicating a bull market from this point.

Another strategy could be to be ‘short puts’ that is being delta positive and vega negative. Delta positive means, as the stock price rises so do the option price and a negative vega is a position that can be benefited from falling implied volatility.

• When VIX is low (generally below 15) it is an indication that the market is bullish and a correction is likely. We go ‘long puts’ i.e. delta negative and vega positive or we can SELL the index.

Image: VIX levels and corresponding S&P 500 Index levels

### Margin debt indicator

A regular cash account allows you to buy securities worth the amount of cash available in the account. For e.g. If you have $5000 in your account and you want to invest in ABC Corporation’s shares which are trading at$100 on the exchange, then you can buy ($5000/$100) 50 shares of ABC Corporation. But if according to your analysis, ABC Corp is undervalued and you expect a rise in the stock’s value in the near term, you can capitalize on this opportunity by asking your broker to lend you money in order to buy securities in your account. To do this, the broker would require you to open a margin account. A margin account is an agreement between you and your broker such that the broker agrees to lend you a proportional amount of money only to buy financial securities (stocks, bonds, and other financial instruments). The collateral for this loan would be the financial securities purchased (ABC Corp stocks in our e.g.). However, there would be a few prerequisites before you purchase these securities on loan and sign the margin account agreement.

• While buying securities on margin, the proportion that is paid by the investor is called as margin and the proportion that is loaned out by the broker to you, to buy these securities is called margin debt.
• These debts taken by various investors are aggregated and published by exchanges because the brokers are required to report this data to the exchanges.

#### Interpretation

• An increase in the total margin debt outstanding over time will coincide with a rise in the market, suggesting aggressive buying and a bullish sentiment.
• A rational reason for an investor buying a stock on margin would be because free cash has been exhausted and the investor still sees an opportunity in buying, as a result, the investor buys on margin.
• But every margin account has its own credit limit or the proportion that the broker loans out to his investors. As these margin investors reach their limits of margin credit, their ability to continue buying decreases, as a result of the demand in the market decreases and the prices may come to a standstill or may even decrease because of weaker demand.
• This weaker demand is a result of investors reaching their limits of their buying capacity both of their own equity (or investor’s cash) and the margin debts (ability to buy securities on loans).
• This may result in a drop in the prices of the shares or the index as a whole, resulting in margin calls.
• Unavailability of free cash and decreasing prices and may force the investors or the brokers to sell securities in these margin accounts, further adding selling pressure, further decreasing the prices to new lows.
• Hence, increasing margin debts tend to coincide with increasing market prices and decreasing margin debts tend to coincide with decreasing market prices.

#### Strategy

• At historical low levels of margin debts, we will BUY the index futures, since there is additional space to buy securities on margin and it might be indicative of an oversold market.
• At historical high levels of margin debts, we will SELL the index futures, since there is no more space to buy securities on margin and a possibility of triggering margin calls.

Image: Margin debt chart and corresponding S&P 500 Index levels

### Mutual Fund cash position indicator

Mutual funds hold a substantial amount of all the investable assets present in the market.

• Mutual fund cash position is the ratio of mutual fund’s cash to total assets.

Mutual fund cash position = (mutual fund’s cash/total assets of the mutual fund).

• This cash can be cash in hand or cash invested in highly liquid money market securities which earn a nominal rate of return.
• Generally, this cash position is up to 5%, which these funds are required to keep available all the time on hand to handle shares redemptions, operating expenses on daily basis and likes.
• Cash also comes into a mutual fund on daily basis from customer (investors) deposits, interests earned and dividends received.
• Cash also increases after a fund manager sells a position and holds the funds before reinvesting them.

#### Interpretation

• During uptrends in the markets, the fund managers would want to quickly invest the cash in the markets because cash (ideal or money market instruments) only earns near risk-free rate returns. Keeping money in cash decreases returns, as investing in uptrends with this cash can earn more than the risk-free rate and increases the performance or overall returns of the fund.
• As a result, generally, when there are medium and long term uptrends in the market, the mutual fund cash position is below 4.5 – 5% as maximum cash is invested in the market with an expectation to make most out of this cash.
• Similarly, during downtrends, investment in cash would earn a near risk-free rate which would be greater than the possible negative return earned in the market. As a result, fund’s cash investment balance increases, expecting to improve fund’s performance or overall return.
• Generally, during such short and medium term downtrends, the cash position may increase to more than 11% in a mutual fund.
• Analysts generally interpret this as a contrarian
• This is because when mutual funds accumulate cash; the fund managers are bearish and this indicates future buying power in the market by these funds.
• A high mutual fund cash ratio suggests market prices are likely to rise in near future.
• On the other hand, when mutual funds’ cash is low, it means they are already invested and market prices reflect their purchases. This leaves less scope for increase in market prices since the fund managers are bullish anticipating rising prices.

#### Strategy

• We would BUY index futures when the mutual fund cash ratio rises substantially more than the previous cash positions in the recent past.

Mutual fund cash position levels and corresponding S&P 500 Index levels; Image source: caps.fool.com

### Conclusion

Always remember, when you trade, do not use these sentiment indicators in isolation. Use indications from more than one sentiment indicators and try to understand the fundamentals and rationality behind such patterns, but be brave enough to take up the contrarian position and capitalize on the fear or greed of other investors.

### Next Step

To understand sentiment indicators like Put call Ratio (PCR), Arms Index or TRading INdex (TRIN) and Volatility Index (VIX) in more detail and to learn how to code an algorithmic trading strategy in Python beating the S&P 500 returns and backtesting it on 2 years data, check out this free course Trading Using Options Sentiment Indicators.

### Introduction

If you are a discretionary trader, you might have asked these questions before

In order to answer these questions, we first need to know what makes these practices stand apart from each other.

In this post, we will make an attempt to decode all the questions related to algorithmic trading vs discretionary trading.

## Overview of Machine Learning in Trading

In recent years, machine learning has been the buzz-word in algorithmic trading and quant firms. In their quest to seek the elusive alpha, a number of funds and trading firms have adopted to machine learning. This post gives a brief overview of the development of machine learning and its growing importance for quants and traders alike.

### Machine Learning gains popularity in Algorithmic Trading

Machine learning techniques can be applied to trading using programming languages like Python, R, C++ etc. Machine learning packages/libraries are developed in-house by firms for their proprietary use or by third parties who make it freely available to the user community. In recent years, the number of machine learning packages has increased substantially which has helped the developer community in accessing various machine learning techniques and applying the same to their trading needs.

Source: kdnuggets.com

There are hundreds of ML algorithms, these algorithms can be classified into different types depending on how these work. For example, regression algorithms are used to model the relationship between variables; decision tree algorithms construct a model of decisions and are used in classification or regression problems (Machine Learning: An Introduction to Decision Trees). Of these, some algorithms have become popular among quants. Some of these include:

• Linear Regression
• Logistic Regression
• Random Forests (RM)
• Support Vector Machine (SVM)
• k-Nearest Neighbor (kNN)
• Classification and Regression Tree (CART)
• Deep learning

These ML algorithms are used by trading firms for different purposes. Some of these include:

• Analyzing historical market behavior using large data sets
• Determine optimal inputs (predictors) to a strategy
• Determining the optimal set of strategy parameters

Here are a couple of machine learning examples for our readers:
Machine Learning and Its Application in Forex Markets [WORKING MODEL]
Predictive Modeling in R for Algorithmic Trading

### Resources to Study Machine Learning

Keeping oneself updated is of prime importance in today’s world. Professional quants and traders who intend to expand their knowledge can take up machine learning courses (part-time or full-time) which are offered by some well-known institutes. This can help enhance their career or provide them additional tools in the development of trading strategies for themselves or their firms.

Here’s a blog on ML resources – Free Resources to Learn Machine Learning for Trading

### Other Research Areas

Machine learning techniques are applied in various markets like equities, derivative, Forex, etc. Machine learning enthusiast/Quants/Traders who intend to apply machine learning techniques to trading should also have some know-how on related subjects like Programming, Basic statistics, Market microstructure, Sentiment analysis, Technical analysis etc.

### Machine Learning Competitions

There are a number of sites which host ML competitions. These competitions although not specifically targeted towards the application of ML in trading, can give good exposure to quants and traders to different ML problems via participation in competitions & forums and help expand their ML knowledge. Some of the popular ML competition hosting sites include:

### Funds using Machine Learning Techniques

Some established funds like Medallion fund, Citadel, D.E. Shaw are said to be using machine learning techniques for trading. However, the extent to which these ML techniques are applied in trading remains unknown to outsiders, and so does the contribution of machine learning strategies in the overall performance of these funds.

There are some hedge funds that have revealed extensive use of machine learning techniques as part of their core strategy. For example, Taaffeite Capital Management (http://taaffeitecm.com/). Taaffeite Capital trades in a fully systematic and automated fashion using proprietary machine learning systems. Here is a list of funds and trading firms that are using artificial intelligence or machine learning.

### Future of Machine Learning in Trading

The rise of technology and electronic trading has only accelerated the rate of automated trading in recent years (Goldman Sachs automated trading replaces 600 traders with 200 engineers). Machine learning has found good adoption with global firms, both big and small. This will get further momentum as quants experiment with new developments in machine learning aided by superior hardware. This makes it imperative for quants and traders to gain a good understanding of machine learning to remain productive in the trading world.

### Next Step

If you want to learn various aspects of Algorithmic trading then check out the Executive Programme in Algorithmic Trading (EPAT™). The course covers training modules like Statistics & Econometrics, Financial Computing & Technology, and Algorithmic & Quantitative Trading. EPAT™ equips you with the required skill sets to be a successful trader. Enroll now!

## Setting-Up an Algo Trading Desk

You need domain knowledge, skilled resources, technology & infrastructure in the form of hardware and software for setting up any business or start-up. The requirements, especially in terms of regulations, infrastructure and cost estimates can vary depending on the country you plan to set up your desk in but overall, things will fall under this umbrella. This blog will give you an overview of the requirements for setting up an algorithmic trading desk or firm.

### Requirements for setting up an Algorithmic Trading desk

1. Registering your company: The first step is to register your firm. You can register your trading firm (for proprietary trading) as a Company, Partnership, LLP or even as an Individual. If, however you want to set up a Hedge Fund with investors, other approvals from regulators (For e.g. SEBI in India and MAS in Singapore) are also required and the compliance rules and regulations are generally much stricter.
1. Capital required for Trading and for Operations: Broadly speaking, trading capital required for High-Frequency Trading is usually relatively less than that required for Low-Frequency Trading. LFT is scalable and can absorb much more trading capital. But the capital required for trading operations is typically far higher in case of HFT as compared to LFT given the infrastructure and technology requirements in HFT.
1. Trading Paradigm: You need to decide on the trading philosophy you’ll adopt. The most common trading philosophies include execution based strategies where the focus is to get the best price for execution rather than focusing on Alpha. Then there are High-frequency strategies which are extremely latency sensitive and mainly include market making, scalping, and arbitrage. Then there are market sentiment based, machine learning based and news based trading algorithms which can be relatively less sensitive to latency as compared to HFT.
1. Access to Market: There are different kinds of memberships which exchanges offer- clearing members, trading members, trading cum clearing members, professional clearing members, etc. If you don’t want to go for direct membership with the exchange, you can also go through a broker. This involves lesser compliance rules and regulatory requirements. However, the flip-side is that you have to pay brokerage and most HFT strategies are highly sensitive to transaction cost.
1. Infrastructure Requirements: Main focus areas under this head are Colocation, Hardware and Network Equipment and Network Lines.

a) Colocation: Colocation means that your server is in the same premises and on the same local area network as that of the exchange. Most exchanges provide colocation facility now. In some cases when exchanges do not provide colocation facility, there are vendors who provide co-location or proximity hosting facility. A significant percentage of orders received by exchanges are now generated by algorithms with most of such orders being generated by co-located space.

b) Hardware: Many leading companies produce servers required for Algorithmic Trading setup. Customizable hardware for high-frequency trading is also available which can be modified as per the requirement to improve performance. Given fast changes in technology, the present scenario requires servers to be changed and updated almost every year or at most in two years.

c) Network Equipment: This mainly includes Routers/Modems, Switches and Network Interface Controller (NICs) and FPGAs. For routers and modems, you need to check version compatibility with exchanges. NICs are basically Ethernet cards which help your computer to get connected to a network. FPGA stands for Field-Programmable Gate Array. It is basically an integrated circuit containing an array of programmable logic blocks and that be configured to perform complex operations.

d) Network Lines: Network lines can be broadly categorised into the below four categories-

i.Trading Lease Line– Used for sending out orders to the exchange. Different lines provide different bandwidth for messages to be sent and are priced accordingly.

ii. Market Data Lease Line– This line used to receive market data from the exchanges or your data provider. There are two main formats ways in which exchanges send market data- Tick By Tick or Snapshot Data (example for NSE).

-> Tick By Tick (TBT)- Tick data is a collection of sequential “ticks” which is the latest quote, trade, price, and volume information. You can also subscribe to bucket feed which filters data for specific instruments requested.

-> Snapshot Data– Snapshot Data feed contains data pertaining to Stock Exchange trade quotations and other related information pertaining to the trading of different instruments generated at regular intervals of time.

iii. Lines between Exchanges: These are point to point lines between exchanges which can assist with SOR. Smart Order Routing (SOR) lets you shoot orders to different exchanges, in effect helping you to pick liquidity available on different exchanges at the most effective price.

iv. Between Premises and Exchange: In India, you cannot have the internet in colocation area, so there is a dedicated line between colocation premises and your facility. The cost of this line depends on the distance.

v. Test Connectivity: Exchanges provide test markets where you can test your trading algorithms. For instance, in India, NSE provides two test markets; Normal test market and Dedicated test market. Some Global exchanges like CME also provide internet VPNs for test connectivity.

1. Algorithmic Trading Platform: An algorithmic trading platform has three main parts-

a) Market Data Adapter– MDA is used to receive data from the exchange and convert it to the format which our trading system understands.

b) Complex Events Processing Engine– CEP is the brain of the system and the main strategy logic lies here.

c) Order Routing System– CEP sends instructions to ORS which converts the order to exchange understandable format. FIX is the most widely used format in most exchanges, some exchanges might have their own native formats as well. When an exchange uses both, a native and FIX format, sometimes native may be preferred due to faster connectivity as the FIX converter might be applied in the next layer but using the exchange’s native format might also involve dedicated efforts in terms of maintenance.

The latency of various platforms varies from system to system and so does the price.

1. Backtesting: Backtesting is a historical simulation of an algorithmic trading strategy to see its performance on the past data. Most ATPs come with backtesting platforms which can be used to obtain simulated results in terms of profit & loss, risk and performance statistics over the duration of the backtested data which help to quantify the strategy’s return on risk. Next, we test the strategy in the “Test markets” which we’ve already discussed in the previous section briefly. Market tests ensure that there are no technical glitches which might occur while connecting to the market through the strategy.
1. Risk Management: Risk management generally involves more focus on Market Risk monitoring. But in the case of High-Frequency trading, Operational Risk is much more important. Failure of technology, network, data streams can be disastrous. You need to have multiple level checks for data, starting from the socket level to capture any anomalies and stop the strategy instantly if something is wrong. A matter of seconds can lead to huge losses, which makes it important to react very fast and disconnect within a few milliseconds or lesser time duration if things go wrong.
1. Conformance and Empanelment: In India, you need exchange’s approval before you take a strategy live. The process involves participating in a mock to give a demo of your strategy to the exchange. If all required conditions are satisfied then the strategy can be taken live. Some exchanges like CME don’t require each strategy to be tested separately; they just test Trading Systems and grant access.
1. Audit & Compliance: All HFT firms in India have to undergo a half yearly audit. Auditing can only be done by certified auditors listed on the exchange’s website. For the audit, you are required to maintain order logs, trade logs, control parameters etc. for past few years. Other global exchanges like CME require similar data to be saved for the past few years for audit purposes.
1. Team: And last but not the least, you need a team of professionals to come together to run your desk. Broadly speaking Traders/Strategists, IT professionals, Network managers, Risk Managers, HR and Legal teams need to work together. But to start with IT professionals and Traders/Strategists should be sufficient. A small team of 3-5 Traders and IT professionals, along with Support Staff, i.e. a total of about 7-10 people can constitute an algorithmic trading firm. In the case of start-ups, a single person can don multiple hats taking responsibility for several tasks and a team of 4-5 members can start.

The trading philosophy and frequency of trading you choose will alter the infrastructure and skill requirements significantly. Selecting the trading philosophy can be a crucial decision for your set-up and will require enough research about different paradigms, markets and the regulations around them.