Showing posts with label NIFTY. Show all posts
Showing posts with label NIFTY. Show all posts

Saturday, October 21, 2017

Systematic Trading | Using Autoencoder for Momentum Trading

In a previous post, we discussed the basic nature of various technical indicators and noted some observations. One of the ideas was: at a basic level, most indicators captures the concept of momentum vs mean-reversion. Most do so in the price returns space, but some in a non-linear transformation of the returns space, like signed returns or time since new high/ low. We presented the idea of a PCA approach to extract the momentum signals embedded in these indicators. From there to a trading model, the steps will be to collate this momentum signal (1st PCA component or higher if required) along with other input variables (like returns volatility and/ or other fundamental indicators) to train a separate regression/ classification model (like a random forest or a deep NN).

One of the issues with using simple PCA is that it is linear and hence may not be appropriate to summarize different measures captured across all these indicators. Here we discuss the next logical improvement - a nonlinear dimensional reduction approach using autoencoder.

As discussed here, the new Keras R interface has now made it very easy to develop deep learning models in R using the TensorFlow framework. Here we use this interface to train an autoencoder to fit the same set of technical indicators on NSE Nifty 50 Index as before. The steps involved are relatively straight-forward. First we generate and standardize the inputs (technical indicators levels). Then we build the computation graph.

To do so, first we define the encoding layers (2 hidden layers, the latent coded unit size is 3, to match the first 3 components of the PCA we use for comparison), and two different decoding layers. The two different decoding layers are to  enable us to train the auto-encoder as well as compute only decoding independently.


Next we combine these layers to create the computational graph. One for the encoder only, another for the decoder, and a third one for the end-to-end autoencoder, that we will actually train.

The rest of it is standard. We define a loss function to map the input to the output, measuring mean squared losses, and train the model. The training is done on data till 2013, and test set is since 2014 till present. Once the training is done, we can use the encoder and decoder separately to generate a dimensionality reduction of the input space and vice-versa.

The output of the dimensionality reduction is compared with the PCA. As it appears from the correlations, the PCAs are almost one-to-one mapped to the three latent dimensions in the hidden layer generating the encoding. So the encoded layers are orthogonal in our case, although this need not be true always.

V1
V2
V3
PC1
1
-0.3
0.2
PC2
0.1
-0.2
0.8
PC3
-0.2
-0.9
0.5

The scatter plot below captures the same, but also highlights the some non-linearity, especially the first component of PCA vs the first latent dimension from the autoencoder.


From here the next step is obvious, replace the PCA factors inputs in the momentum trading model in the first paragraph with these latent dimensions from the autoencoder and re-evaluate. This will capture a richer set of inputs that can handle non-linearity and hopefully performs better than linear PCA. Here are some results what other reported (opens PDF). Here are some more (opens PDF) on the using autoencoder for cross-sectional momentum trading. The entire code is available here.

Friday, September 22, 2017

Macro | A Paradigm Shift For India's Retail Investors?

The Indian economy is at an interesting point. We had two large scale policy moves in recent time - the much controversial Demonetization in November last year, and the implementation of (a somewhat rundown version) of Goods and Services Tax regime this year. Early this month, we had the first GDP print following these two major steps. The headline prints came in lower than consensus - 5.7 percentage for Q2 vs. 6.5 (and 6.1 last quarter). This was followed by equally weak Industrial Production release. A stronger than expected headline CPI prints did not help, as this squeezes the room for any rate cuts from the RBI.

A closer look at the GDP data (see component break-down in the chart below) shows some serious weakness. The private consumption part (C) has weakened significantly following the demonetization (the vertical red dashed line). The investment component (I) has been weak for a while (although staged a comeback in the last quarter). Exports growth was not helped by a strong rupee. In last few quarters, government expenditure helped the headline a lot. But the sustainability of this is questionable. We will have the fiscal deficit data out later this month. But the street does not expect anything great.

The story of the IIP paints a similar picture (see chart below, overall IIP, manufacturing, base materials, consumer durable, consumer non-durable, capital goods, electricity, intermediate goods and mining respectively). While demonetization appears to have caused a negative shock, in general most of them peaked out before that, around early 2016 to be fair. The capital goods, which staged a minor comeback since bottoming out in 2014, again resumed the downward trend, along with most (except consumer durable, and to some extend mining).


This is all in a relatively benign global macro scenario. In spite of the Fed taper 2.0 announcement, we have little jitters in the markets. Rates, both global and local, are relatively low and volatility remains subdued. Oil prices remain range-bound. A rally in oil along with a weakening INR following Fed and expected ECB taper later this year can worsen the scope of fiscal stimulus. Most in the business sectors does not expect private investments to turn around before end of this year at the earliest. The investment exuberance back in 2004-06 left many corporates laden with unmanageable debt burden and bank balance sheets with NPA.

In this background of weakening macro story, the Indian equity markets is in a tear. The flagship NSE Nifty Index posted a YTD 21%+ gain, among the best globally and compared to it's own history. The trailing 12-month PE ratio is looking worryingly high. High valuation remains a big concern among investors in this, and most other traditional metrics (a bit better in terms of price to book).

However, comparing the PE ratio to its historical average is not very good way to capture everything that goes on to determine fair price. In the most basic approach, the price of equity is a function of market risk free rates (say the local sovereign bond) and equity risk premium. Following the approach in this paper from AQR, I modeled the BSE SENSEX P/E based on the risk factors - the bond yields as well as the equity and bond volatilities (as in the original paper) along with current account balance as a percentage of GDP (reflecting the fiscal risk of the economy) and spread of bond yields to US Treasury (captures the flow risks). The last two are more relevant for an emerging market economy like India. The time-series shows a marked shift in relationship between pre- and post-crisis era. I fitted the model only on (monthly) data from 2010 onward to capture the recent dynamics. As it turns out, the bond vol has little contribution to market risk premia for India. The bond yield and equity vol shows significant but low correlation, whereas the CA deficit and spread to treasury captures a significant portion of the variance. The chart below shows the fit on this model (adjusted R-squared ~0.72).
According to this model, the PE ratio is only slightly on the over-valuation side - not a cause of great alarm. According to this model, the market was highly over-valued around late 2011, and early 2015. We saw corrections in both cases. Also the under-valued period, early this year, was followed by upward corrections as well. This model does not forecast a large correction anytime soon unless we rally up a lot quickly from here (obvious caveat: these are in-sample results).

But what is most interesting, and perhaps most significant is the recent flows that we have seen in Indian equity markets. Traditionally, the equity markets in India has been shunned by a large portion of retail investors. The experience of scams in 1990s and the melt-downs, once during dot-com busts and another in 2008, did not helped. The foreign portfolio investors dwarfed the domestic flows in cash equities for a long time (although it is a different story in F&O). But since 2014, something changed. The extra-ordinary flows in to the equities markets, led by domestic mutual funds (presumably on the back on retail savings channeled to equities) completely outpaced the foreign flows.
Is this a mass optimism following the 2014 election outcome and equity rally? Or are we witnessing a major shift in the savings behaviour of retail investors in India. The retail money has missed the initial come-back equity rally following the 2008 crash, and a part of the early 2014 rally as well, where the foreign investors made out handsomely. But much of the late rally in Indian equities has gone to the retail pockets. Is this dumb money chasing recent gains? We do not know for sure, but as we argued above, we are some distance away from any valuation melt-down in Indian equities. And the flow signifies the loss tolerance of the retails - who are sitting on some comfortable profits - has quite a bit room before panic. And finally, the weakening property markets and demonetization may have incentivized a permanent change in retail behaviour.

We do not know for sure. But what is the implication if it is indeed a fundamental shift in savings behaviour? As argued above, the macro in India is down, but with policies properly executed, the turn-around can be sharp. If oil remains range-bound and the Fed and ECB do not stray afar from the implied forward curves, we will have little in terms of global shock to upset the local economy. On the other hand, the efforts to put banking sector NPA in shape, along with the full kick-back of the GST regime should significantly improve the badly needed private investments. Add to this mixture this retail savings paradigm shift, and we are looking at the very beginning of a multi-year rally in Indian equity markets.

Sunday, August 2, 2015

Systematic Strategies: A Simple Statistical Pattern Matching Algorithm

Time series pattern matching in finance is an area which borrows from statistical techniques and mathematical tools from various other disciplines to make an educated guess about near term price movement.

The basic idea is simple: Suppose we have data of price evolution for last n periods, and want to know which way it statistically biased to move for the next m period. Given a set of past data, a pattern matching algorithm searches for best-fit n-period samples (matches) from the data sets and analyze statistical properties of next m period. From these information we can make some probabilistic statements about the likely evolution of the price series we are interested in. For most pattern matching algorithms the basic operation is more or less as above. The area they differ is how they define "best-fit" (a measure of fit - i.e. likeliness, or more generally, a measure of difference, i.e. distance) and also how they find the matches (clustering techniques).

One way to define distance is the conventional crow-flight distance (also know as Euclidean distance). To see how this applies to a price time series, assume we have daily data for last 20 days we are interested in. To define the distance from another 20-day sample, we compute the square of differences for each day between the two series (i.e. difference of the first day of first series and first day of the second series) and then sum them up and take a square root. There is a host of ways in which we can measure distance. See here for a list for example.

For picking up the top matches, there are many ways. One popular, and easy to implement, is a method known as k-mean clustering.

Once we have decided a measure suitable for our purpose and way to choose top matches, the rest is easy. We need to define what statistical properties of the matches we are going to assess and how to interpret that and generate a buy or sell signals.

I have here taken an example with NIFTY futures (the flagship index of National Stock Exchange in India) with 1 minute bar data. To illustrate, see the figure below (click to enlarge). Imagine for a given date (1st July here), we see the price movement (the black line) up to a certain time in the day. We need to match this with history (the orange lines) and predict the move today. Finally the green line shows the actual move that realized. Below I describe the scheme of this strategy.


For the statistical parts: I have chosen a distance measure known as Markov Operator distance (see here, opens PDF). This is a bit more suitable for our purpose, as Euclidean distances are sensitive to jagged movements typical in stock price evolution. Also before measuring the distance, I have smoothed the data to filter noises. We can, again, choose from a host of options (any low pass filter will do). I have used a simple kernel regression smoothing. Note, since we are smoothing the data, Euclidean distance measure should not perform particularly bad for us. Lastly for choosing the top matches I stick to k-mean clustering as mentioned above. 

With this scheme, our strategy is simple. We look at the price evolution each day for a given n period. Then match this for daily 1 minute bar data since April 2015 and generate a trading signal based on the statistics of the top matches. Here I have chosen a set of very simple parameters - we buy (sell) if 1) the subsequent returns from the matches are positive (negative), 2) Sharpe ratio is above a certain threshold and 3) the skew (as define by ratio of 90 and 10 percentile move) is above a certain threshold in our favor. The results are as below (click to enlarge).


The graphs shows the performance of the strategy during the late June/ entire July 2015 (total 23 days). The right chart shows performance (profitable move captured) for different n (the period till which we sample each day). For example, since NIFTY starts trading from 9:15 AM, and we have 1 min data, n=100 means we wait 100 mins or till 10:55 AM before taking a decision. As can be seen performance degrades the more we wait. The left chart shows the profit (the round dots) vs max draw-downs and max upside (either end of the sticks) for each trades for n=100.

For a simple strategy, the performance is impressive. Further scope for improvement is 1) to extend scope of pattern search to any n-period time of the day instead of matching only relevant time periods. 2) improving on the distance function or the smoothing techniques. For example Dynamic Time Warp is a candidate here, especially if we extend the scope as in 1. 3) improve optimization in terms of n, the thresholds in Sharpe and skew etc. 4) improve execution in terms of take profit/ stop loss

[Edit 1: for those interested in the code and implementation, you can find it here, pick up the two files on k-nearest neighbor strategy]

[Edit 2: this extends my previous post on intraday momentum back-testing. Technically they are similar, except in the first case we take a simple snapshot to decide a signal, and here we take a certain length of sample to generate a signal]

Tuesday, June 30, 2015

Back-Testing Systematic Strategies Part 1: A Flow Chart Based Approach

Systematic trading brings on a certain discipline and the advantage in terms of risk management that comes along with it. And with today's cheap computing power, it is available to anyone. A proper back-testing is almost always at the core of a systematic trading strategy. A wisely designed back-test is the litmus test for an investment hypothesis. At the same time, it helps in sizing the trades and risk management given a particular ability and appetite to take on risks.

However, for the individual traders and investors who has developed market insights over the years, but not very familiar or eager or able to get their hands dirty with coding, running a back-test with dependable results can be a huge headache. Here I try to show how we can approach this problem in a structured manner.

The very essence of back-testing is defining some rules of trading (buy or sell signals) and risk management (stop loss or take profit etc.) based on a market price (of the instrument we are trading) and probably some more indicators (which can be as simple as a technical indicator, or a complex function defined by the user). The R package quantstrat handles this problem in a very well defined manner and split the functionalities in different blocks or modules so that designing a back test, running the strategy and analyzing the data all becomes simple and modular. We take a simple example of running a intraday momentum strategy on the National Stock Exchange flagship index NIFTY50 to highlight this point.

The core strategy we want to back-test is simple. Every trading day we wait for a certain amount of time (or price bars) after the market opens to see the initial momentum. If the open is positive (negative) beyond certain threshold, we then go long (short). Before the end of the trading day we square-off the position. Optionally we can also add a stop loss and take profit target. 

Thinking backwards, the back-test will be driven by our buy and sell trading rules and square-off rule. In turn they will be generated based on:

a) if the opening price criterion meets the condition and 
b) if we are at the beginning of the day, and finally 
c) if we are approaching end of day to place square off. 

This in turn means, the signals that need to go in is: 

i) a price move indicator for positive move
ii) a price move indicator for negative move
iii) a start-of-day indicator and 
iv) an end-of-day indicator

We would need i) and iii) both to be true (logical AND) for a buy signal, and ii) and iii) for a sell signal. The indicator iv) is enough to drive square-off. Schematically, the entire scheme looks below


And if we can design this schematic logically, in terms of a simple, easy to understand flow chart as above, it becomes rather straight forward to develop the underlying codes to run the strategies. As an example I ran the strategy for 2-minute bar of intraday data since 19th of May to 26th of June, and here are the results with different combinations (with 100 units for buying or selling for each trade).



For the underlying strategy without any stop-loss and take profit targets, the trade positions and evolution of profit and loss looks as below (click to enlarge).


And once we run the back-test, we can further delve in to the details and analytics, like the chart below which plot the Maximum Adverse Excursion plot for the base strategy
In short, a very simple strategy, quickly designed in to a simple flow charts. The back test shows it really works, and also throws lights on how to size the trades given your investible capital and risk tolerance.

We will further follow up on how to translate any back-testing in to a similar flow chart, which enables quick and reliable back-testing.

(Those who are interested in the underlying code, it is available here.)

Tuesday, March 24, 2015

Nifty: Small Caps vs Large Caps

Focusing back to Indian Equity markets!

The interplay between small cap and large cap has been very interesting back home, compared to global benchmarks. For last couple of years, S&P 500 and Russell 2000 more or less matched each others performance. In late 2013/ Early 2014 the small cap index outperformed, which is now reversed by a relative under-performance. Compare this to India. Ever since the financial crisis, the market recovery has been led by the large caps. Small caps (or mid caps) consistently under-performed, except since last June. The election saw a large out-performance by the small caps, but otherwise it has been pretty much dull. Small caps premiums has been in fact negative.

We take a look at the financials to see if there is any clue there. Below the aggregated balance sheet for Nifty 50 stocks, vs. Nifty Mid cap 50*



And here are the corresponding PnL figures*


* All data from Bloomberg as they report. I think more or less the trend is captured here.

As we can see, one large issue with the small cap balance sheet is in general total indebtedness. Since 2007, both the large caps and small caps companies increased their sales 2.3x, with an increase in balance sheet in the 3.44x/3.42x range. However while for Nifty companies it has been funded 70% by non-current liabilities, for Nifty Mid cap 50, the figure is at 80%. Both not great, but mid cap definitely worse. On top, the figures for small caps were worse to begin with. So the current levels look far from comforting from investors' point of view.

On the other hand, as far as the standard valuation parameters are concerned, on both revenue and balance sheet related metrics (like price-to-sales or P/E pr P/B) large caps are slightly overvalued (relative to historical spreads).

So overall it is not a straight forward call. Small caps are undervalued, but not by much as they were before mid 2014. At the same time, the overall sector balance sheet looks vulnerable to any interest rates shock. The question is if that valuation compensates for the leverage risks. Given the current outlook, probably this will tilt in the favor of small caps and mid caps over all. But not without a constant watch. I will definitely avoid any adventure in this space.

Sunday, December 21, 2014

NIFTY: Day traders Vs. Investors (+ A Christmas Present !!)

Here are some interesting charts comparing how S&P CNX Nifty has performed over last many years - split between day-session performance vs. overnight. The pattern is very interesting. In 2007-2008, the day traders dominated, both in profits and in losses. Be it the run up to the pre-crisis top in early 2008, or the crash. It was again the day traders who profited most in the comeback in 2009. This continued till the peak in 2010. 

However, after that, something changed. 2010 was the last great year for the day traders. Since 2011, the overnight returns dominated returns during the day session, far and steady. That was the case during the mild bearish runs in 2011, the sideways market in 2012. And the trend continues strongly in to the current bull period. 

The overnight returns now dominates day session so much that if this continues, going long overnight and shorting the markets during the day is now a super profitable strategy !!



What is driving this? Well to start with: the vols are down, and NIFTY (like most emerging markets) is perhaps influenced by the Feds and the BoJ much more than it used to be back in 2007. I would suspect most emerging markets will show very similar patterns. And this is VERY different than, say , S&P 500, where overnight and day-session has their fare share of misery and joy.

Will this continue? Well, the flow of funds that world-wide QEs initiated is still churning around, and will perhaps take a long time before the dust settles down. But it is an altogether different scenario if we enter a high vol regime in 2015, irrespective of market direction.

The tail piece: for folks looking for public source of intraday data on stocks - here is a quick and dirty R scripts. Feel free to use and modify as you please. Quantmod of course does a wonderful job for daily data. This routines are similar and extend to intraday.


. Merry Christmas and happy holidays everyone!

Friday, August 8, 2014

This is NOT Nuts, Where is the Crash?

The secret of making money in the market is to bet against it and then be right as well. As a far-fetched corollary, we can also say when everyone is worried about a market crash, that is perhaps not the best time to actually position for a crash. Even if they are central bankers warning of over-valuation of certain stocks or warning of outright market crash. Central bankers have not shown particular excellence and consistency in timing the markets. Keywords charts for "asset bubbles" and especially "market crash" bursting through the roofs here!



So here we take a look at the global market valuation. We have all range of valuations, from downright moribund Russian stocks to upbeat Mexico. And these excludes much of emerging and frontier markets. As good as a time to stay invested for long term, as any other time. And look for value.


And the markets seem to understand. We have hardly seen any great shift in momentum in equity flow. We have seen recent outflows in emerging market debt, high yield and developed markets equities. And also some increased flows in to US and core Europe bond funds. But before you listen to financial analysts and talking heads, there are very little evidence of flight to safety here. On longer term, what we are seeing is NOT rotation, rather a reflation, i.e. money continues to flow in to both bonds and equities. This is corroborated by central banks flows of funds accounts, as well as other higher frequency flow data. The amount of recent outflows from US equities is dwarfed by the amount pumped in since the financial crisis.



There are reason to believe these latest rounds flows in to bonds has little to do with safe heaven demand. The unforeseen consequences of changes in regulatory landscape (BASEL 3, SOLVENCY 2, all leading to higher bonds demands) and austerity and stress on balanced budget (leading to lower supply) may be the major driver. Clearly yield chasing has been significant as well, but there is some amount of caution out there - see the recent outflows of high yields. The real dangers are the developed economies getting in to the next recession following a natural business cycles from a much lower peak than past recoveries, and a China problem. But none of these present an extreme tail scenario to me. And if your expectation is a total Chinese melt-down, then heaven save us! So unless we see a central bank induced shock therapy gone wrong, a crash may never come anytime soon. At least not when everyone is looking for it! 

And even if it does arrive, probably it will be safer to stay in equities than in fixed income

And, oh, if someone tells you the evidence of irrational exuberance in the equity market is the insane levels of margin debt on NYSE and/or the cheapening of put skew, just sigh and shake your heads.

Friday, July 11, 2014

NIFTY: Technicals - Choose Your Divination!

Now with the budget out of the line, we will be trading relatively event-less in near term more or less. So focus is less macro and more micro, stock-picking and timing the markets etc. In case you rely on technical indicators, here is a quick summary of what works and what does not among the weapons in the technical traders' arsenal for NIFTY. All data from Bloomberg.

The first chart shows the total performance of different strategies based on technical indicators, against simple buy and hold. The whiskers show the maximum and minimum annual returns, while the thicker bar s show the average annual returns in a trending market and in a range-bound markets (it is white if trending return < range bound return and black otherwise). The data spans 2004 to YTD 2014. The trending years are identified as 2004 to 2007 and then 2010 and 2014.


The second chart shows the relative rankings of strategies in a given year (1 is the best, 23 the worst). Again the whiskers show the best and worst ranks over the years and the thick bars show the average annual ranks in trending as well as range bound markets (again, it is white if the average trending rank is lower than, i.e. better than, average range bound rank)



So based on this if you believe we are in a trending market, NOTHING beats the simple strategy of buy and holds. And if you think we are in a range bound market, the best performing strategy is a variation of moving average (Triangular moving average - a three-point double-smoothed variation of the moving average method, with majority of weights in the middle point).

In general, you are better off following Ichimoku or different variations of moving average methods in a trending markets (if buy and hold is too simple for your taste!). And in range bound market also, the moving averages perform relatively better than other complicated indicators. But even then, they do not beat the simple buy and hold strategy by a large margin.

Of course, as we all know, past performance is not indicative of future returns.

Tuesday, June 10, 2014

NIFTY: Inside Stories

Reported insider selling has been quite active lately for Indian listed equities. So we take a quick look at it



Looking at the graphs, here are some stylized facts

1) the inside selling activity has been most wide spread recently. Although the total value of gross and net insider selling has come off the peak in April 14, the number of companies involved is still much higher than last few years average

2) The aggregated inside selling does not appear to be a good predictor of the general direction of the market. It seems, the company insiders are usually happy to lock in a local maxima after a slump in price.

3) Give 1 and 2 above, it may not be time yet to worry about the end of the bull market

Thursday, May 15, 2014

NIFTY: Are FIIs Really Overweight India?

I have my doubts

Here is an interesting article from the good folks from FTAlphaville

What is striking is that although the general feeling is that the FIIs have been "euphoric" about India and its' resurgence under Mr Modi as the PM, as I see, the data fails to show the same. Here are couple of charts to drive home the point.



So irrespective of what analysts at foreign banks says, I think a large part of the rally in the Indian equity markets so far this year has been driven by domestic buyers or may be even retail money. And a lots of potential FIIs flows sitting on the sidelines. Through the last phase of the election campaigns and actual elections, my perception is that FIIs have been cautious and decided to follow a wait and watch policy. And it would not take a dramatic positive results for NDA to kick start the next leg of the bull run. A simple confirmation of average exit polls prediction will do.

Wednesday, May 7, 2014

Yet Another India Vs China Story

A very interesting piece from IMF Direct blog!

It captures how the trade integration within Asia has phenomenal compared to other regions globally for last two decades, centered on the China growth story. And it also highlights how this has resulted in increased synchronization, and increased propagation of growth shocks between regional partners. This, is claimed, has given rise to a high correlation among Asian economies, as they provide this chart for quick evidence


And when I look at this chart, I find India has a pretty interesting position. In fact some might argue, based on this chart, that betting on a Chinese shocks can be structured through short Australia and Korea and long India and Philippines, adding statistical leverage.

Although I am doubtful this negative correlation in economies will translate to the correlations in markets in the event of a severe chines slowdown. Irrespective of how good or bad the economic story is, India will face consequences on international financial flows if we see a real serious slow down in China. The question is what happens when the dust settles down. India is a net importer from China, with some overlaps of export to other developed countries. So certainly will suffer much less directly through a slowdown in China. In fact can even benefit from reduced competition in global markets. But by any means economic downturn of the second largest trading partner is no good news, even if it runs a net trade deficit.

But if the slowdown in contained, I think there will be some focus on this issue and India will see some part of the flows from the Asia focused funds, trying to limit Chinese exposure

In fact, long-term market correlation supports this. NIFTY has been much more correlated to S&P 500 ...


... than Shanghai Composite



Monday, April 14, 2014

NIFTY: Election 2014 Positioning... Eliminate Tough Decision Making

The current move in NIFTY, expected to end in a crescendo after the elections, is probably one that will be the defining move this year. If you have already missed the rally so far, or fail to capture the large expected moves after the results are out, your portfolio performance is probably doomed for this year.

The question is do you really give a damn. You are in the game for the long term, right? it does not matter if you miss an election move or two.

So... a first strategy for election 2014 is, well, DO NOTHING. It is so often overlooked in the heat of things that doing nothing can turn out to be a pretty neat strategy. If it rallies after the results you will capture it anyways. If it sells off, you were buying value right? So unless we have a radical outcome, it should be an opportunity to buy.

Okay, now let's say you DON'T plan to do nothing. Here is a way to think about your move. 

Like poker, in markets too, apart from the goal of making money, another important objective is to avoid tough decision. Because tough decisions are always emotional, and that is exactly when you are most likely to make mistakes. And avoiding tough decisions in future is achieved simply by making choices now that makes your decision easy later on.

So let's apply this rule to see how you should be positioned. First thing first. I have no clue which way the market will move from here. Nor does anyone. Let's assume for argument's sake, the market has an equal chance of a large rally or a correction from here. If you go short now, and it does make a correction, congratulations! You made it. Now what if it does not? You make a loss on your shorts, AND you miss the rally. That's okay, no big deal. But what next? can you enter it now? You thought the market was already on the higher side and then it rallies quite a bit more. All you are going to do is to spend the next 6 months on the sideline waiting for a dip. A large one at that. You missed the entire 2014!

Now the other side of the bet. Suppose you went long. The market rallies. Well done. Now you take a re-look at the valuation and decide further action. And what if it corrects. No big deal. It just offers a more compelling valuation then. Way better outcomes no matter if you are right or wrong

And that's the kind of bets to make. Because with markets, the probability that your views are right is not much different than pure chance

NIFTY: Great Expectations?

Here is a fantastic background for India 2014, more so for the uninitiated! (Do click)

And now the questions is how much juice left in this rally and which sectors are really overheated. Below a snapshot of the relative performance of different sectors vis-a-vis the benchmark (NIFTY) index. As you can see the rally that started late last august once quite contained. But the pre-election rally (a possibility I noted before) has been, well, fantastic. With all the usual suspects racing away - only Energy, Pharma, FMCG and IT still lagging.



The question is what now. Obviously the pattern of the rally since March shows a lot have been on expectation of a radical shift in policy after the elections are done with. PSU banks, Real Estate, Financials, commodities and energy sectors especially seem to have performed on this expectation. How realistic these expectations are - a few wise words from JP Morgan (via FTAlphaville)

The belief in certain quarters is that as long as the next government were to go all out at de-bottlenecking projects, sentiment would surge and this would spark an investment revival in the economy. However, this appears to be an overly-simplistic read on the situation for at least three reasons.
First, the vast majority of projects are currently stuck because of issues that are under the purview of state governments, over which the central government has little jurisdiction...

They also warn of the circular link between the bank bad loans and stalled infra projects. Do go read the full text. 

One thing is sure, we do have rallied a lot on expectation. Or rather hope. That is not saying we can't rally further. But given the uncertainties of election outcome, the tail risk of hung parliament results may not be a tail risk. That can rattled the market which seem to have priced in too many rosy assumptions

Thursday, April 10, 2014

Trivia: Dance of Democracy

The election time is here again in the largest democracy in the world. Here is a link from an old post back in 2009 (the last general election). A mathematical awakening for all those lost in debates over Mr Modi's ghosts from the past, Mr Gandhi's incompetence, Mr Kejriwal's lack of direction and irrelevance of others. 

Actually the only system that will work for you is a dictatorship in which YOU are the dictator!!

Jokes apart, democracy is built on institutions. I honestly don't mind lack of leadership, as long institutions  are strong. If you think a country is a super example of a complex system, it is far better for it to walk randomly and find direction through evolution and time, than hurtling at Mach 2 in a direction under a great leader only to realise later as a nation it was wrong direction to begin with. 

Have a great time voting. By the way the implied volatility levels where the options on Nifty are trading, my back of the envelop calculation shows if u want to cover the time decay from now till the election results are out, the volatility levels should be around 50%. That will be higher than the 2008 crash!