The Gateway to Algorithmic and Automated Trading

Sharekhan shows how a small Indian fund can reap big returns

Published in Automated Trader Magazine Issue 26 Q3 2012

In this edition of Automated Trader's regular look at smaller players in the automated trading space, Andy Webb talks to Rohit Srivastava in Mumbai, whose firm Sharekhan Limited is the only long-short fund in India. The firm's trend-following tactics have helped it generate a return of 146 percent for the $20 million under management during the six years from early 2006.

Rohit Srivastava

Rohit Srivastava

Rohit has written of how the first time he set his eyes on price movements in the markets, identifying trends became a passion. Here he tells Andy how he and Sharekhan have put that passion into practice.

Andy Webb: Let's start with a little bit about Sharekhan Limited and how it's organised.

Rohit Srivastava: It's a public limited company and it's a stock-broking company, but it's registered with SEBI which is similar to the SEC. We take funds from clients and execute them on different portfolios.

Andy Webb: Which index futures are you actually trading?

Rohit Srivastava: We're trading the Indian index called the Nifty Futures. I do it in another product, which is called Trailing Stops, which is not automated, but it's again managed futures where we trade stock futures.

Andy Webb: So with the automated one trading the Nifty, you're going long and short - and you say yours is the only such fund in India?

Rohit Srivastava: That's right, in India essentially nobody has gone ahead and launched absolute return products or long-short products where you go long and short on the market. We don't even have inverse ETFs or any such products. The only ETFs are in gold and the Nifty - they are on the long side, called Nifty BeES and Gold BeES, which are right now being traded.

So India's a very nascent market when it comes to alternative investments. It was my thought that you would have more a secular kind of market ahead and that we needed such products.

But because Indians are still not aware of such products, they're not used to investing in them. So we have two categories of people: one is the speculators, who want leverage and therefore feel that they don't want to be in a product which is not trading leveraged; and second there are investors who are used to long only or buy and hold products. For that reason the fund has not grown. We've been marketing it and getting a few clients every month, but it's not really exploded despite the returns.

Rohit Srivastava

Andy Webb: Interesting that you can get a return of that level while working on 100 percent margin basis. And not using leverage is required by regulation?

Rohit Srivastava: The portfolio management services of India were designed by SEBI in '94. They wanted it to be only for investment. At that point of time we didn't even have derivatives in India. Derivatives got introduced only in 1999. So prior to that, since it was only for investment, what they said is that you must only buy shares and you must hold on to them for the long term, and so on... Because we are still using the old guidelines, we stick to those guidelines. Even if I am long on Nifty futures I am only paying the exchange 15 percent or 10 percent margin, 90 percent of my cash remains idle, which means I end up putting in a liquid fund which is basically a money market fund or bond funds which are equivalent to cash. So we usually have excess cash which we put into such funds so the funds are not idle. But we have to operate assuming that there's 100 percent margin even though the exchange does not charge us that much. And that's both on the long and short side, so even if I go short I have to have 100 percent margin.

Andy Webb: Are you applying a single model to this portfolio or multiple different models?

Rohit Srivastava: This particular portfolio is based on a single model. I'm using a single timeframe which is the daily price data.

Andy Webb: What did you use for the development platform and backtesting platform for your model?

Rohit Srivastava: At the time I was developing I was using Metastock.

All I was looking for was that whatever model I finally developed had linearity - which means that it grew at a particular rate, the drawdowns were limited within a defined level, and that the risk-reward ratio was closer to two.

So keeping those broad themes in mind I used basic principles of testing and applying some of the tools that I was using to trade. Once I came up with the model which showed me a good rate of return for a period of time, I was able to modify and improve on it from time to time. We also came up with some external exit rules, which we've been able to add to the system. When you get very big swings we're able to book out and take profits.

But the rules are all defined, there is no human intervention on the rules.

Andy Webb: Have they all been modifications within Metastock using its own language, or have you had to use external plug-ins to Metastock to be able to do them?

Rohit Srivastava: Most of the modifications were within Metastock, except for the exit tools. Those rules ended up being external to the system. We've not been able to develop a way of automating that part.

Typically we do around 30-40 trades a year. It's not a very high frequency system. Each time that we are executing, because it's daily prices we don't execute today's trade tomorrow, which means if on today's closing price I'm going to get a signal to buy or sell we execute it before the market closes in the last 15 minutes. So for domestic investors doing a bulk order is possible, with one dealer at my end who can sit on the terminal and execute within two minutes. But if I am dealing with non-resident Indians then it's not possible, so that is one area where I'm actually looking for automation, which we are still to develop.

Andy Webb: Presumably you have an intraday data feed in order to do get data and get a signal and get the orders done.

Rohit Srivastava: That's right. I use software called Iris. It's from a company called Spider Software. It's an Indian company and they provide the intraday data feed which we use to monitor the closing. Essentially, we need this because the system runs on closing prices and calculates the signal on closing prices. Closing prices on the Nifty and Sensex are purely based on the weighted average of the trading of the last half an hour. So the last half an hour's data becomes important for us. We therefore take a judgement on the last half an hour data on the Spider Software as to whether it's closing within the level of whether we'd get a buy or sell signal or not.

Andy Webb: What happens if you get a buy signal based on real-time data that is not confirmed by the official closing price. Do you still leave the trade running or do you cancel the following day, reverse it?

Rohit Srivastava: We would reverse it the following day, although that never happened to date. If there is a doubt before the close, you'll probably not do the entire quantity, you'll probably do half, and do half the next day. If it does happen that we do a transaction and it does not show up in the final close, then we would close the trade out the following day in the morning.


Andy Webb: You have a number of different tools and feeds. Let's talk about how that is organised.

Rohit Srivastava: Sharekhan takes live feeds from the stock exchange. It's the trading platform which allows you to execute trades at the exchange, so we offer it to clients.

The Iris software, just like Metastock, is charting software. But it's a real-time feed. It provides real-time data for both the Bombay Stock Exchange and the National Stock Exchange price data. We get real-time data, tick by tick data from them.

Andy Webb: So the model you tested and built on Metastock, have you recoded that model for use on Iris's platform?

Rohit Srivastava: No, I didn't need to recode because I'm using Iris only for one purpose, which is calculating what the closing price for the day will be. Then once I have that approximate value, then Metastock, the model tells me whether that would generate a buy signal on it. Because we are able to do testing on Metastock in advance we know what is the price range in which we would generate a signal. So we know that usually in the morning itself. We know that today, if between 3:00 and 3:30 the average comes above this or below this, we'll know we need to go long or short. All we're doing in the last half an hour is monitoring Iris for whether the price is coming in that range or not.

Andy Webb: There are a lot of trend-following models out there. Can you define in general terms what it's seeking to do? Does it use proprietary indicators or analytics you developed or standardised technical tools?

Rohit Srivastava: It's a combination of both. There are some standardised technical tools for calculating averages, looking at linearity of price data, whether you're getting a linear trend or whether it's curving downward. And there are certain momentum indicators which I've modified based on my experience over time.

I've added volatility filters over time into it, which based on the market volatility would filter out a bad signal on whether a larger move should result in a buy or sell signal or even a smaller move should result. So if the volatility expands we would filter out smaller ranges and if it contracts then we would allow even smaller range signals to come into it. That actually reduces a lot of the bad trades and the drawdown risk.

Andy Webb: Do you continue to re-evaluate the model or do you regard the model as not requiring a great deal of additional enhancement?

Rohit Srivastava: I'm not working on any new models at the moment. But I do keep reviewing it to look at whether I can improve the performance or reduce the drawdown. Those are two areas that I've tried to work on, as and when we get feedback from the salespeople or clients, based on how the returns have been moving versus the market. They come up with particular expectations, and I try to test whether I can put those expectations into our model.

Andy Webb: It sounds like you have a strong focus on drawdown. What's your maximum acceptable percentage drawdown?

Rohit Srivastava: The system works on a maximum drawdown of somewhere between 20 to 25 percent. We've seen up to around of 23 percent drawdown for clients.

We tested it on the Indian index called the Sensex which has data from 1978. We've seen around six drawdowns since 1978 close to 20 percent, which is what we tell clients, that intra-year you can have a 20 percent entire drawdown at any point of time. But, apart from that, the testing shows that even despite the drawdowns we get a long-term CAGR which is close to 46 or 47 percent. This is before costs. Basically there are slippages in executions between the tested index, which is Sensex, and the executed index, which is Nifty futures. And also between Nifty and Nifty futures. So we presume around 8 to 10 percent of slippage, which brings us down from 46 percent to around 38. Then we charge fees - the fees are brokerage of around 0.05 percent on each transaction, which results in around 2 percent cost to the client annually and 20 percent performance fees, which means 20 percent of any profit he makes. All of that brings down his expected return after cost close to a long-term CAGR of around 30 percent. That's before taxes.

And taxes in India, actually derivatives-based profits, get taxed at what we call business income, which is 30 percent.

Andy Webb: It sounds as if your testing and simulation performance has been reasonably similar to your real-time performance.

Rohit Srivastava: That's right, that's right, with some basic slippages.

Andy Webb: When you originally tested the model, did you test it on one batch of data which had a particular set of parameters, and reserve a second batch of data for testing using the same parameters without further optimising the model?

Rohit Srivastava: No, I did optimisation. I had to do that to get the best results. Essentially, I came across a list of guidelines for testing models from one of the books that I read. It showed me that each indicator individually which I'm using to run on the system should give me results in the form of a bell curve. If I'm optimising, if it doesn't fit the bell curve then the data's erratic, I may just choose one data point which might appear to make performance good, but any small variation in data could cause performance to go further down. So I saw that each of the indicators, when I was optimising, were giving me bell shaped results for whatever I was using. And then I chose the best time frame within that to actually come up with the right combination of tools that formed the model.

Say I'm using three tools. First I did individual testing of each tool, then I did combinations of the tools and looked at each of those, so that I could get the right combination of those tools.

Andy Webb: So you're still monitoring the model and you're still looking to maybe make improvements, but you're not looking to build new models. It sounds in a sense like you've got the performance pretty much there with the model anyway. I'm assuming you're probably trying to spend more of your time actually getting more investors to realise what a good thing it is.

Rohit Srivastava: That's right. That's one part of the work, that's getting people in. In fact, we are also trying to look at trying to set up an offshore means of getting foreign money to get in these products. Apart from that, we are also working on some other products.

Andy Webb: Half an hour before the close you'll take the price of the futures, feed that into Metastock, Metastock either does or doesn't trigger a buy or sell signal. That buy or sell signal, is that output to a spreadsheet and then passed across to your trader to manually execute the trade?

Rohit Srivastava: Yes, we all sit in the same room so it doesn't need an email. The two of them, the dealer and the person who's verifying the trade both sit together and the moment he sees it's triggering, he executes it immediately.

Andy Webb: It's very simple. With the domestic clients he's only got essentially one trade to do, I suppose.

Rohit Srivastava: That's right. It's the size of the trade that he's got to execute.

Andy Webb: Does the model incorporate any sizing functionality in that you have different gradations of strength of signal when you do a bigger or larger sized trade - or is it always a standard sized contract?

Rohit Srivastava: It's always a standard size.

Andy Webb: And is that size occasionally significant in the market, to the point that it has to be broken up into smaller lots of trades, or is it one that you can execute as one trade?

Rohit Srivastava: It does have to be broken. The reason for that is that the stock exchange doesn't allow you to punch in an order which is larger than 10,000 Nifties at a time. So they have defined a quantity. So if I have to do, at a time, say 100,000 Nifties long, then it would have to be split into 10 trades.

We can enter them simultaneously if we want. There's the portfolio management software which we use, which does the allocation as to how much quantity we would need for each client. It would give out a batch file. And we just push that batch file into the stock exchange terminal. It would automatically create those trades.

Andy Webb: Do you find that your trader is adding significant performance in the way they execute the trade? For example, if the trader perceives that by delaying execution for three minutes or two minutes, better opportunities may occur. Or is it an order the trader has to execute straight away?

Rohit Srivastava: We don't permit that because the time is often limited. Sometimes, if the market is very close to the signal level, which means we could get a buy signal if the average was just a few points higher or lower, we often have to monitor the Iris data until the last five minutes of market close. So if he has to execute within five minutes he has to execute. So he's really not left time for him to think whether he should buy or not. Once we confirm, he just has to execute the order.

Andy Webb: You get the basic signal 30 minutes before the close, but you're waiting for confirmation that it is going to close as close as possible before he actually fires the order.

Rohit Srivastava: Yes, we don't execute anything until the last 10 minutes of trading.

Andy Webb: In terms of execution, do you plan to stick with the way you're doing it or do you think you might move over to a completely automated process at some point?

Rohit Srivastava: I think we could move to a completely automated process. There's not been much development in terms of software, though recently we have been approached by a couple of people who started developing algorithmic models and some execution models. That's something we need to explore. It was not there earlier.

If I had to break, for example right now, 100,000-200,000 Nifties, 10-20 lots is not so difficult. But if it ends up becoming much larger, many times that, then I would end up either needing several dealers to execute it or else, ideally, I would have it automated. So the execution would, I think at some point of time, have to get automated.

Andy Webb: Do you think if you go that way you will continue to execute very close to the close each night, or do you think you might consider executing beginning the following morning session?

Rohit Srivastava: I have done backtesting based on the closing prices, opening prices and next day prices. The difference in returns, just if I execute on the closing of the same day or the opening of the next day, can bring down my CAGR - which as I say was 46 percent - all the way down to less than 30 percent.

Andy Webb: OK, so there's a big difference.

Rohit Srivastava: It's a huge difference. But when you actually test and see, it matters a lot.

Sharekhan shows how a small Indian fund can reap big returns.