powered by
Returns pricing data for a specified stock
get_stock_data(symbol, start_date, end_date)
A string indicating the symbol of the stock in the PSE and Yahoo Finance. For more details, you can refer to this link.
A string indicating a date in the YYYY-mm-dd format, serves as the start date of the period to get stock data
A string indicating a date in the YYYY-mm-dd format, serves as the end date of the period to get stock data
A tibble, with the following columns:
symbol: The ticker symbol of the stock
dt: The date for the closing price of the stock
name: The name of the company represented by the stock ticker
currency: The currency of the closing price of the stock
close: The closing price of the stock at the given date, dt
percent_change: The percentage day change of the stock
volume: The total value of shares traded of the stock at dt
# NOT RUN { get_stock_data("JFC", "2019-01-03", "2019-02-01") # PSE data get_stock_data("MSFT", "2019-01-03", "2019-02-01") # US data # } # NOT RUN { # }
Run the code above in your browser using DataLab