Given the tickers, buy-in date, sell-out date, returns the historical prices and profit/loss

gather_stock_returns(api_key, ticker, buy_date, sell_date)

Arguments

api_key

character API key (sandbox or production) from Intrinio

ticker

character ticker symbols or a vector of ticker symbols

buy_date

character the buy-in date in the format of " If the input date is not a trading day, it will be automatically changed to the next nearest trading day.

sell_date

character the sell-out date in the format of " If the input date is not a trading day, it will be automatically changed to the last nearest trading day.

Value

a dataframe that contains the companies, historical prices and corresponding profit/loss

Examples

gather_stock_returns('OjhlMjhjNTBmMWJiMWE0MTExYjQwNWZmZTVkZWM1', c('AAPL', 'CSCO'), "2017-12-31", "2019-03-01")
#> [1] "Invalid API Key: please input a valid API key as a string"