Is there more steam left in the market? #
Analysing whether NIFTY is overvalued/undervalued using P/E ratio #
P/E ratio or price to earnings ratio is an indicator many investors use to guage whether the stock or index is overvalued or undervalued (you can read more on P/E here). NSE provides historical P/E ratios for various indices so in this article we will see how the NIFTY P/E ratios have varied historically and what it could mean in current scenario.
from datetime import date from nsepy import get_index_pe_history, get_history
lets download P/E ratios and NIFTY historical values right from 2005 till today (18 Dec)
nifty_pe = get_index_pe_history(symbol="NIFTY", start=date(2005,1,1), end=date(2020,12,18)) nifty = get_history(symbol="NIFTY", start=date(2005,1,1), end=date(2020,12,18), index=True)
Save the dataframe for later use so that we don’t have to fetch the data again
Lets combine the two dataframes and see how nifty and P/E move together
nifty['P/E'] = nifty_pe['P/E']
We will now see what kind of yearly returns you would have got, had you invested in NIFTY at a particular P/E level. For this we will calculate forward looking returns by shifting Closing price by 252 (there are approximately 253 trading days in a year in US, it might be slightly different for India but for our analysis few days here and there would not matter much)
nifty['Shifted'] = nifty['Close'].shift(periods=-252) nifty['ForwardReturns'] = (nifty['Shifted']-nifty['Close'])*100/nifty['Close'] nifty[['Close', 'Shifted', 'ForwardReturns','P/E']].head()
As you can see from above table, if you had invested in NIFTY on 3rd of Jan 2005 at P/E of 15.57, you would have got returns of 36.32% a year later. Now lets look at a scatter plot to see what kind of annual returns we would expect by investing at different P/E levels.
nifty[['ForwardReturns', 'P/E']].plot.scatter(x='P/E',y='ForwardReturns', figsize=(20,10), grid=True)
Few conclusions we can draw from historical data -
- Lower the P/E at the time of investment, higher the annual return investor has received
- There are very few instances of negative annual returns for P/E < 20
- You are highly likely to get a negative annual return if you had invested at P/E > 27.5
As of today (18th December 2020) the NIFTY P/E stands at more than 35 and NIFTY looks highly overvalued in my opinion. Let me know what do you think in the comments below.
The above analysis is for educational purpose only, readers are advised to use their own judgement or consult your investment advisors for any investment decisions.