knitr::opts_chunk$set(echo = TRUE)
A simple client to access the Alpha Vantage Market Data Api. Only the TIME_SERIES_DAILY_ADJUSTED and TIME_SERIES_INTRADAY endpoints are exposed.
library(avR) library(tidyquant)
aapl <- time_series_daily_adjusted("AAPL",from = "2019-01-01", to = "2019-06-01") aapl
aapl_id <- time_series_intraday("AAPL",nDays = 1) aapl_id
Note that the data is returned as a tibble (dataframe)
ggplot2::ggplot(aapl ,aes(x = datetime)) + geom_candlestick(aes(open = aOpen, high=aHigh, low= aLow, close = aClose)) + ggplot2::ggtitle("APPLE DAILY",subtitle = "from ALPHA VANTAGE")
ggplot2::ggplot(aapl_id ,aes(x = minute,y=close,colour=date)) + geom_line() + ggplot2::ggtitle("APPLE Intraday",subtitle = "from ALPHA VANTAGE")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.