Rblpapi (version 0.3.8)

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 = NULL,
  con = defaultConnection())

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.

con

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

Value

This function always returns NULL.

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

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

Examples

Run this code
# 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 DataCamp Workspace