This Package takes two stocks from YahooFinance as xts objects with their respective closing price. It model them as a time series to find the Rollingmean. Then, to plot both them by a ggplot geometric line, build a dataframe and transform the character dates into Date type to observe the annual data trends.
install the package
devtools::install_github('unimi-dse/edf3d358')
library(STONK)
Tickr1 <- Get_Tickers("AAPL") #Check ticker' symbol on Yahoo
Tickr2 <- Get_Tickers("FB")
ClosingPrices <- Resume(Tickr1, Tickr2) #Merge and clean data
Analysis(ClosingPrices) #Perform basic analysis
df <- Modeldf(ClosingPrices) #transofrm data in a data frame to easily plot
Plot_Ticker(df, df$AAPL.Close, df$FB.Close)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.