Documentation Center

  • Trial Software
  • Product Updates

Connection Object Properties

The syntax for the Bloomberg® V3 connection object constructor is:

c = blp;

Retrieve Connection Properties

To retrieve the properties of a connection object, use the get function. This function returns different values depending upon which data server you are using.

get(c)

c =
 
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: 'localhost'
         port: 8194.00

You can get the values of the individual properties by using the property names:

get(c,{'port','session'})

ans = 

       port: 8194.00
    session: [1x1 com.bloomberglp.blpapi.Session]

For example, return just the connection handle with the ipaddress argument:

ip = get(c,{'ipaddress'})
ip =
    localhost

    Note:   A single property is not returned as a structure.

Retrieve Data on a Security

Establish a connection, b, to a Bloomberg communications server:

c = blp;

Use timeseries to return data on a security:

d = timeseries(c,'IBM US Equity',floor(now));

To return data on a particular field for a range of dates, use history:

data = history(c,'IBM US Equity','Last_Price','07/15/2009','08/02/2009')
Was this topic helpful?