Learn R Programming

dataonderivatives (version 0.2.1)

get_bsef_data: Get Bloomberg SEF data

Description

The Bloomberg Swap Execution Facility (SEF) offers customers the ability to execute derivative instruments across a number of different asset classes. It is required to make publicly available price, trading volume and other trading data. It publishes this data on its website. I have reverse engineered the JavaScript libraries used by its website to call the Bloomberg Application Service using POST requests to a target URL.

Usage

get_bsef_data(date, asset_class = NULL, curate = TRUE)

Arguments

date
the date for which data is required as Date or DateTime object. Only the year, month and day elements of the object are used. Must be of length one.
asset_class
the asset class for which you would like to download trade data. Valid inputs are "CR" (credit), "IR" (rates), "EQ" (equities), "FX" (foreign exchange), "CO" (commodities). Can be a vector of these. Defaults to NULL which corresponds to all asset classes.
curate
a logical flag indicating whether raw data should be returned or whether the raw data should be processed (default). The latter involves selecting particular fields and formatting these as seemed appropriate based on data and API reviews at the time the formatting was coded.

Value

a data frame containing the requested data, or an empty data frame if data is unavailable

References

http://data.bloombergsef.com

Examples

Run this code
## Not run: ------------------------------------
# library (lubridate)
# # All asset classes
# get_bsef_data(ymd(20140528))
# # Only IR and FX asset classes
# get_bsef_data(ymd(20140528), c("IR", "FX"))
## ---------------------------------------------

Run the code above in your browser using DataLab