Learn R Programming

Rblpapi (version 0.3.15)

subscribe: Subscribe to streaming market data

Description

This function uses the Bloomberg API to stream live market data

Usage

subscribe(securities, fields, fun, options = NULL,
  identity = defaultAuthentication(), con = defaultConnection())

Value

This function always returns NULL.

Arguments

securities

A character vector with security symbols in Bloomberg notation.

fields

A character vector with Bloomberg query fields.

fun

An R function to be called on the subscription data.

options

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.

identity

An optional identity object as created by a blpAuthenticate call, and retrived via the internal function defaultAuthentication.

con

A connection object as created by a blpConnect call, and retrieved via the internal function defaultConnection.

Author

Whit Armstrong

Details

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.

References

https://bloomberg.github.io/blpapi-docs/cpp/3.8/

Examples

Run this code
if (FALSE) {
  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