powered by
This function uses the Bloomberg API to stream live market data
subscribe(securities, fields, fun, options = NULL, identity = NULL, con = defaultConnection())
A character vector with security symbols in Bloomberg notation.
A character vector with Bloomberg query fields.
An R function to be called on the subscription data.
An optional named character vector with option values. Each field must have both a name (designating the option being set) as well as a value.
An optional identity object.
A connection object as created by a blpConnect call, and retrieved via the internal function defaultConnection.
blpConnect
defaultConnection
This function always returns NULL.
The subscribe function allows one to subscribe to streaming market quotes.
Full detials of the subscription string can be found in the header file blpapi_subscriptionlist.h.
http://bloomberg.github.io/blpapi-docs/cpp/3.8
# NOT RUN { subscribe(securities=c("TYZ5 Comdty","/cusip/912810RE0@BGN"), fields=c("LAST_PRICE","BID","ASK"), fun=function(x) print(str(x$data))) # }
Run the code above in your browser using DataLab