nhafer88 / stock-analysis

Analyzed stock data on a list of green energy stocks using VBA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stock_exchange

Finding the Green, Data Analysis on Green Energy Stocks

Project Overview: Purpose and Background

  • This project provides analysis on list green energy stocks, looking at their volumes and returns for 2017 and 2018.
  • The information from this analysis may aid in expanding investment knowledge.
  • The analysis was conducted using Excel and VBA programming.

Results

Comparing Green Stocks Returns Between 2017 and 2018

  • There were more positive returns for these green energy stocks during 2017 compared to more negative returns during 2018.
    • One possible reason for this difference of returns between 2017 and 2018 was due to the Great Recession began in Decemeber 2017.
  • The two stocks that were able to show positive returns in 2018 were SunRun, Inc.(RUN) and Enphase Energy, Inc.(ENPH).
    • Unlike all the green stocks, RUN saw an increase in return compared to the previous year.

Comparing Executuion Times of Original Script and Refactored Script

  • The execution times for the refactored script (seen in the images below) ran faster than the original script
    • Refactored script times: 0.082 seconds (2017 data) and 0.078 seconds (2018 data)
    • Original script times: 0.660 seconds (2017 data) and 0.668 seconds (2018 data)

VBA_Challenge_2017 VBA_Challenge_2018

Conclusion: Pros and Cons of Refactoring Code

  • In general, the advantages of refactoring a code is that it improves the effectiveness and sustainability of a software program.
  • The downside that we sometimes see is that refactoring incorrectly or imprecisely may lead to impaired functioning of the software as well as holes in the software security that could make it more susceptible to hackers.
  • Refactoring my VBA script, my ran noticeably faster than it had with the original script. The downside in refactoring this script was it was tedious and time-consuming. I had to constantly check the codes that I was inputing were effectively and correctly running the analysis.

About

Analyzed stock data on a list of green energy stocks using VBA