TANKY
Note: This blog should not be construed as financial advice but rather as a pointer towards using data science in ones financial decisions. Further, it is advisable to hire the services of a qualified professional to assess the analysis and above all, to do one’s own research prior investing.
Wealth Creation Conundrum. India is possibly witnessing the fastest wealth creation era in its history and things have changed very much from 2012 to what it is right now 10 years later. <hurun india rich list: India witnessing fastest wealth creation era in its history: Hurun India founder - The Economic Times (indiatimes.com)>. The million dollar question is “Has one missed the bus?? Should one wait for things to cool off a bit??” The FOMO effect could force one to make unreasonable decisions. This is where the science of data analytics could step in and help one make well informed and duly analysed decisions.
Common Stock Investments. Without doubt, investments in common stocks have been a prudent way in wealth creation. The main issue however is to effectively manage the return vs risk balance. In an earlier blog <TANKY - Portfolio Creation & Optimization (datawiz.co.in)>, we covered the strategy required to be adopted towards creation of an effective portfolio and thereafter optimise it proactively on a periodic basis. However, in a bull market such as the one in motion, one would be spoilt for choice in respect of which scrips to pick.
Cherry Picking as an Investment Strategy
In a bull market, investor is spoilt for choices. Every other stock is presumably doing well. However not exercising due diligence in picking scrips for investment could result in avoidable financial losses. The best strategy would be to select about 30 to 40 scrips of companies having strong fundamentals in robust sectors into a basket.
The second step would be to use techniques of data analytics to ascertain the returns vs risk continuum of each of the selected scrips. And finally, we shortlist a few based on a set threshold of return and risk.
As an example the stocks I would pick up on this day are the following:
Python for Cherry Picking
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse and as a programming language is scalable and flexible. It has a vast collection of libraries for numerical computation and data manipulation. Python also provides libraries for graphics and data visualization to build plots.
Populating the Dataset
We use a web crawler to populate the dataset with weekly price variation data from say 1st Jan 2015 till today i.e. 05 Oct 2021. The data looks like this:
Price Variation Plots: The variation of prices in few of the selected scrips was plotted to see the characteristics of the variation over the six-year period:
Creating Price Stock Return Dataset. Next, we calculate the weekly percentage changes (logarithmic or difference) of these stocks and store the values in a different dataset. The obtained dataset is as indicated below:
Establishing mean returns and mean standard deviations (risks). Next, we calculate the means and standard deviations of each of the scrips. The mean return gives an indication of potential future weekly returns whereas the mean standard deviation gives an indication of the potential risks (upside or downside) in the weekly returns. The return/risk of the selected scrips over the past 6 years performance is as shown:
Risk-Return Plot. Next, we plot the average returns and volatility against a selected threshold (zero average return and 5% volatility in the instance case). All the scrips meeting the threshold criteria can be picked up for investment.
Thus, based on the past 6 years data, the scrips meeting our investment criteria are the following:
The Google Colab sheet is embedded for reference.
Happy investing!!!