EU Stocks Data Application

Aman Tiwari
27-09-2021

Description

  • In this app we try to plot the EUStockarkets data from datasets package using the plotly function.
  • This dataset contains the daily closing prices of major European stock indices: Germany DAX (Ibis), Switzerland SMI, France CAC, and UK FTSE. The data are sampled in business time, i.e., weekends and holidays are omitted.
  • Also we try to let the users enter date values, select their choice of the Index and then calculate the percentage change in the given time period.

Access

  • Access the codes to the UI and server functions through github here
  • Access the shiny app here
  • Now we will get into the UI and Server functions in detail

UI Logic

  • First we load all the required libraries required to perform all the operations.
  • Then using the ts_data.frame function we transform the EuStockMarkets data into a data frame.
  • After this we correct the format of time coloumn to “%Y-%m-%d”.
  • After all this preprocessing, we try to get inputs from the user in the sidebar panel
  • First, we get the input regarding the index
  • Then we get the starting and end dates.
  • After this we define the output i.e. plot and percentage change in the main panel.

Server Logic

  • In server first we define the reactive functions so that we can get the values of the indices from the given time frame and it changes values as soon as the user changes the values in input.
  • Then we plot the data using the renderplotly function.
  • After that we show the percentage change in the index values using the reactive functions defined earlier.