alpha_vant: Alpha Vantage Function

Description Usage Arguments Value Examples

View source: R/alpha_vant.R

Description

Alpha Vantage Function

Usage

1
alpha_vant(stock_symbol, frequency, interval = NULL)

Arguments

stock_symbol

this is the ticker symbol for the object

frequency

this refers to frequency of the data. Valid values include intraday, daily, daily_adjusted, weekly, weekly_adjusted, monthly, monthly_adjusted,

interval

in the case that the user desires intraday data, you may select the time intervals for the intraday data frame. Valid values include 1min, 5min, 15min, 30min, 60min

Value

returns a data frame given the parameters of the API query.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
alpha_vant("GOOGL", frequency = "daily") # a simple example

matrix1 = matrix(
  c(
    rep(1,3),
    rep(1,3),
    rep(1,3),
    rep(2,3),
    rep(2,3)
  ), 
  nrow = 5, ncol = 3, byrow = TRUE
)
with(subset(GOOGL_DAILY, GOOGL_DAILY$date > as.Date("2010-01-01")),
     {
       layout(matrix1)
       plot(date, open, type = "l", main = "GOOGL")
       lines(date, high, col = "blue", lwd = 0.3)
       lines(date, low, col = "blue", lwd = 0.3)
       
       plot(date, volume, type = "l", main = "GOOGL", col = "#108a4c")
     }
)

im2wddrf/AlphaVantageQuery documentation built on Nov. 4, 2019, 2:09 p.m.