Generating the Probability of NEPSE Index Crossing Over 5000 points in Early 2025 (Simulation Using Python)
Sat, Oct 1, 2022 5:57 AM on Stock Market, Exclusive,
Generating the Probability of NEPSE Index Crossing Over 5000 points in Early 2025 (Simulation Using Python)
Introduction:
Will the Nepal Stock Exchange (NEPSE) Index cross over 5000 in future? I can see this discussion among fellow investors around me from time to time. In this article, I will answer the question with reference to the previous bull and the Index data collected from 2012 September 13 to 2022, September 13.
The entire process will be presented step by step for easier understanding of readers with the python code used in the project:
- Step one: Importing the required modules and loading CSV files in python:
First, I imported the required modules used for data analysis and presentation and the file ‘nepsealpha_index_all.csv’ which contains the NEPSE index data from 2012 September 13 to 2022, September 13.
- Step Two: Finding the lowest and Highest closing point of the index in previous bull
Input:
Output:
We can see that the lowest point before the index reached 3198.19 high was 1100.58 and it took the index 541 transaction days to reach the high from the date 2019-03-03 to 2021-08-18.
- Step 3: Calculating per year growth rate of index from 2012 to 2022:
Input:
Output:
In this step we have calculated the per year average growth of the index or the slope which is 151.504 points per year. Then we divided it by 244 days, which is the average number of working days in a year after deducting Saturdays and other public holidays in which the market remains closed. If we distribute the linear yearly growth trend for each transaction days, it is 0.62 points per day.
- Step four: Finally, the most important step of simulation of 3 possibilities:
4.1) Simulating previous bull and calculating the probability of previous bull occurring:
Input:
Output:
In this step we first simulated how much would the index reach in 541 days from 1100.58 if the NEPSE index decreased or increased randomly from -6 to 6 percentage. The process of the calculation is at step 50. After that every 541 days index points are appended to a list in step 52 and finally the last element which would be the index point at the last day is appended to another list which will be containing the total 10000 different possibilities that the index could be at the end of 541 days shown in step 53 of the image.
The probability of NEPSE index crossing 3198 in 541 days from the lowest 1100.58 was 28.37 percentage. So, we can consider it as a benchmark for future anomalies and use it as a comparison for 2025 simulation.
4.2) Simulating the index again from the recent lowest point of 1848.28 to calculate the probability of index crossing over 5000 point in 541 transaction days (early 2025):
Input:
Output:
After repeating the same process we can see that the probability of NEPSE index crossing 5000 points is 18.96. So, if we consider the previous bull as a benchmark for comparison there is 9.41 percent (28.37%-18.96%=9.41%) less chance for such anomaly to occur within 541 days.
4.3 Checking for probability for index crossing 3000 in 541 days in the simulation:
Input:
Output:
In above codes the numbers of alternate last day of 541 days are counted which are above 3000 and later divided by the total events (total alternate last days of ending day of 541 days). The calculation showed that the probability of such anomaly occurring is 29.89 percent which is higher than the probability of previous bull occurring by 1.52 percentage.
Conclusion
Simply speaking the random simulation study showed that if we take previous bull as the benchmark for comparison there is 9.41 percent less chance that the index will reach 5000 points in early 2025. However, there is 1.52 percent more chance compared to the previous bull for the index to cross 3000 points in early 2025.
Romin Neupane
MBA Finance,
School of Management Tribhuvan University
Data science pursuant, Data Camp
Investor
Email: romin8985@gmail.com