Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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())

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.

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.

Value

This function always returns NULL.

Author(s)

Whit Armstrong

References

Examples

## Not run: 
  subscribe(securities=c("TYZ5 Comdty","/cusip/912810RE0@BGN"),
            fields=c("LAST_PRICE","BID","ASK"),
            fun=function(x) print(str(x$data)))

## End(Not run)

Rblpapi

R Interface to 'Bloomberg'

v0.3.11
file LICENSE
Authors
Whit Armstrong, Dirk Eddelbuettel and John Laing
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.