In this Project I am performing a stock Analysis for Person named Steve who asked me to analysis a green stock for his parents to see if it is worth investing in. In order to do this, I needed to use the Visual Basic Appication in Excel to find the stock's total daily volume and annual return. After completing this analysis, I continued to analyze 11 more green stocks to see how the first one compared to them. For there, I was able to use the analysis to let Steve know what would be the best option for his parents.
The purpose of this project was to make an efficient way to look at multiple stocks using VBA. After being able to run the analysis of these 12 different stocks the first, it was apparent that there was a more efficient way to work with the data given. In order to make the analysis more efficient, I needed to refactor my code. This project looks to see if my refactoring made the analysis more efficient.
The table below displays the analysis for a dozen green-energy stocks (companies that use alternative energy rather than fossil fuels in the form of Hydroelectricity, Geothermal energy, Wind Energy, and Bio Energy). The table contains three groups of data: Ticker name. Total daily volume for a given year. Percentage of a yearly return.
Green-energy stocks in 2017 had a high ratio of positive yearly returns (only one green-energy stock (TERP)) had a negative yearly return. Analysis from 2018 showed a completely different picture. The majority of stocks had negative returns. The drop was significant. The DQ stock had almost 200% yearly return in 2017, but in 2018 the stock dropped and finished the year with negative 63%. These results indicate a risky investment. The stock trend is not stable and might not be worth investing all the money in DQ stocks.
In general, a high volume of daily trading is an indicator of a stable stock, with a lot of interest and activity. It is true that in some cases low trading volume can be promising, especially where companies “that have yet to be discovered”(1). DQ stocks in 2017 had low volume and high yearly return (at that time this might be an indicator of a company on a rise). However, the situation of DQ stocks in 2018 has changed completely. Stocks closed its year with negative 63%. Trading volume was higher, yet didn’t result in a positive outcome. The results of this analysis confirmed a risky investment in DQ stocks.
The major advantage of refactoring code is making the code more efficient.It run faster then regulart codes calculation The major disadvantage of refactoring code is that you are taking code that already works and potential making it unusable if you can refactor it correctly. For that reason it is always smart to save your original code just incase you end up not being able to refactor it. Hear are images comparision of All Stock Analysis with All Stock with refactor function
The major advantage of refactoring code in VBA script is that you can use as much as of the original code as you want to and can put your new code side by side with your old code using different modules. The major disadvantage of refactoring code in VBA script is that if you do not have a strong understanding of the syntax, you will struggle to refactor your code as the syntax matters so much more when trying to make your code more efficient.