Retrieves equity historical book data from Bloomberg. Books include 'key stats', 'income statement', 'balance sheet', 'cash flow statement' and 'ratios' or retrieves it from an existing storethat SQLite database.
pull_equity_book( source = "Bloomberg", book, tickers, start, end, verbose = T, file = NULL, ... )
| source | a scalar character vector. Specifies the data source for the query: "Bloomberg" or "storethat". Defaults to "Bloomberg". |
|---|---|
| book | a scalar chatacter vector, 'key stats', 'income statement', 'balance sheet', 'cash flow statement' or 'ratios'. |
| tickers | a chatacter vector. Specifies the Bloomberg equity tickers to query data for. |
| start | a scalar character vector. Specifies the starting date for the query in the following format: 'yyyy-mm-dd'. |
| end | a scalar character vector. Specifies the end date for the query in the following format: 'yyyy-mm-dd'. |
| verbose | a logical scalar vector. Should progression messages be printed? Defaults to TRUE. |
| file | a scalar chatacter vector. Optional parameter that specifies the target storethat SQLite database file to retrieve data from. |
| ... | optional parameters to pass to the bdh function from the
Rblpapi package used
for the query ( |
An S4 object of class EquityKS (book = 'key stats'),
EquityIS (book = 'income statement'), \linkS4classEquityBS
(book = 'balance sheet'), EquityCF
(book = 'cash flow statement'), EquityRatios (book = 'ratios').
if (FALSE) { BBG_KS <- pull_equity_books(source = "Bloomberg", book = 'key stats', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) BBG_PL <- pull_equity_books(source = "Bloomberg", book = 'income statement', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) BBG_BS <- pull_equity_books(source = "Bloomberg", book = 'balance sheet', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) BBG_CF <- pull_equity_books(source = "Bloomberg", book = 'cash flow statement', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) BBG_R <- pull_equity_books(source = "Bloomberg", book = 'ratios', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) storethat_KS <- pull_equity_books(source = "storethat", file = "~/storethat.sqlite", book = 'key stats', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) storethat_PL <- pull_equity_books(source = "storethat", book = 'income statement', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) storethat_BS <- pull_equity_books(source = "storethat", file = "~/storethat.sqlite", book = 'balance sheet', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) storethat_CF <- pull_equity_books(source = "storethat", book = 'cash flow statement', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) storethat_R <- pull_equity_books(source = "storethat", file = "~/storethat.sqlite", book = 'ratios', tickers = c("BP/ LN Equity", "WEIR LN Equity"), start = "2000-01-01", end = as.character(Sys.Date())) }