Learn R Programming

AlphaVantageClient (version 0.0.1)

fetchSeries: Fetch time series data

Description

This is the main function that pulls data directly from Alpha Vantage into a convenient xts object. This is a general function that reflects exactly the documentation listed online.

Usage

fetchSeries(function_nm, ...)

Arguments

function_nm

The function name. While case insensitive, this argument needs to be exactly as listed in the documentation. Examples include time_series_daily, sma, and bbands.

...

Other arguments. If a required argument is missing then an error will be thrown. If an optional argument is missing then a warning will be thrown.

Value

A two element list: the first element is the xts object named xts_object and the second is the raw http response named httr_response (see httr package for details on this class)

Examples

Run this code
# NOT RUN {
setAPIKey()
example_prices <- fetchSeries(function_nm = "time_series_daily", symbol = "msft")
example_sma <- fetchSeries(function_nm = "sma", symbol = "msft", interval = "daily",
                           time_period = 10, series_type = "open")
# }

Run the code above in your browser using DataLab