fmpc_price_history_spldiv: Historical EOD pricing, split, and dividend data for one or...

Description Usage Arguments Details Value Warning Examples

View source: R/pricing.R

Description

Pulls End of Day prices, splits, and dividends for a list of symbols. Symbol can include equity, mutual fund, index, currency, crypto, or any other symbol that can be found in fmpc_symbols_by_market.

Usage

1
2
3
4
5
fmpc_price_history_spldiv(
  symbols = "AAPL",
  startDate = Sys.Date() - 360,
  endDate = Sys.Date()
)

Arguments

symbols

one or more symbols from the FMP available list that can be found using fmpc_symbols_by_market. A valid API token must be set in order to enable functionality. See documentation for setting a token under fmpc_set_token.

startDate

filter start date in yyyy-mm-dd format.

endDate

filter end date in yyyy-mm-dd format.

Details

Uses functions fmpc_price_history, fmpc_security_dividends, and fmpc_security_splits to aggregate split, dividend, and pricing data into a single data frame. Warnings may be generated that split data or dividend data was not returned. Results will still show in this function if price_history data is available.

Value

a data frame of pricing, split, and dividend history

Warning

Each symbol is THREE separate API calls. If the API token has monthly limits, this should be considered before making a bulk request. Large Symbol requests will also take time because of the buffer time between API calls.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Setting API key to 'demo' allows for AAPL only
fmpc_set_token()
fmpc_price_history_spldiv('AAPL')

# For multiple symbols, set a valid API Token
fmpc_set_token('FMPAPIKEY')
# Index, currency, and crypto will return data even without splits/divs
fmpc_price_history_spldiv(c('AAPL','MSFT','SPY','^SP500TR','JPYUSD','BTCUSD'))


## End(Not run)

fmpcloudr documentation built on March 2, 2021, 1:06 a.m.