Stocks Dashboard (CSV)

Home

Dataset Information

For this exercise, we will use data from the AlphaVantage API. Specifically we will use the "Time Series Daily (Adjusted)" premium endpoint to fetch historical stock prices about a given company. In this dataset we will focus on the adjusted closing price, which accounts for stock splits. Consult the API documentation to learn more.

Setup

First obtain an AlphaVantage API Key, and supply it when prompted. Unlike the other exercises, to fetch this stock data, we specifically need to use a "premium" key, which can be obtained from an instructor.

Feel free to optionally modify the list of selectable stock symbols in the Stock Selection Form by manually editing the options within the designated select element.

Part 1

Write JavaScript code to answer the questions below. Log each of the answers to the console. NOTE: Format all prices as currency using a dollar sign and rounding to two decimal places. NOTE: Format all percentages with a percent sign and rounded to two decimals.

  1. Define a function called updateDashboard. It should:
  2. Invoke the function once when the page initially loads (no need for an event listener).
  3. Add an event listener to also invoke the function whenever an option is selected from the dropdown menu in the Stock Selection Form.

Part 2

Write JavaScript code to answer the questions below. Display the answers on the page in the designated areas. Use the same currency and percent sign formatting as in Part 1 (except for the chart).

  1. Revisit the updateDashboard from Part 1. It should also:

Dashboard

Stock Selection Form

Outputs

Date Range: TODO to TODO

Earliest Close: TODO

Latest Close: TODO

Percent Change: TODO

100 Day High: TODO

100 Day Low: TODO