main content

bloomberg b-凯发k8网页登录

bloomberg b-pipe connection v3

description

the bpipe function creates a bpipe object. the bpipe object represents a bloomberg® b-pipe® connection.

other functions connect to different bloomberg services: bloomberg desktop (blp), and bloomberg server (blpsrv). for details about these services, see .

for details about bloomberg connection requirements, see . to ensure a successful bloomberg connection, perform the required steps before executing bpipe. for details, see .

creation

description

example

c = bpipe(authtype,appname,ipaddress,port) creates a bloomberg b-pipe connection object c, and sets these properties:

example

c = bpipe(authtype,appname,ipaddress,port,timeout) also sets the timeout property.

example

c = bpipe(authtype,appname,ipaddress,port,timeout,tlscred,tlspassword,tlstrust) connects to a b-pipe zero-footprint cloud solution using the specified credentials file, password, and trust file.

caution

to refer to a bloomberg connection in other functions, use the connection object created by the bpipe function. otherwise, using bpipe as an input argument opens multiple bloomberg connections, causing unexpected behavior and exhausting memory resources.

input arguments

credentials file, specified as a character vector or string scalar that contains the full path to the credentials file with the extension pk12. for details about the credentials file, contact bloomberg.

data types: char | string

b-pipe password, specified as a character vector or string scalar. to obtain your b-pipe password, contact bloomberg.

data types: char | string

trust file, specified as a character vector or string scalar that contains the full path to the trust file with the extension pk7. for details about the trust file, contact bloomberg.

data types: char | string

properties

this property is read-only.

application authentication type, specified as one of these values:

  • "" — bloomberg b-pipe connection with windows® authentication

  • "appname_and_key" — bloomberg b-pipe connection with application authentication

bloomberg user authentication type, specified as one of these values:

  • "os_logon" — bloomberg b-pipe connection with windows authentication

  • "application_only" — bloomberg b-pipe connection with application authentication

for details, see the bloomberg b-pipe api developer’s guide using the wapi option from the bloomberg terminal.

application name, specified as a character vector or string that identifies the application you are using to connect to bloomberg b-pipe.

example: 'appname'

data types: char | string

this property is read-only.

bloomberg user, specified as a bloomberg user identity object.

example: [1x1 com.bloomberglp.blpapi.impl.at]

this property is read-only.

bloomberg v3 session, specified as a bloomberg v3 api session object.

example: [1x1 com.bloomberglp.blpapi.session]

ip address of the machine running the bloomberg b-pipe process, specified as a character vector, cell array of character vectors, string, or string array. a character vector or string identifies the machine running the bloomberg b-pipe process, whereas a cell array of character vectors or string array specifies multiple machines.

example: {'111.11.11.112'}

data types: char | cell | string

port number of the machine running the bloomberg b-pipe process, specified as a numeric scalar.

example: 8194

data types: double

timeout specifying the time in milliseconds that matlab® attempts to connect to the machine running the bloomberg b-pipe process before timing out, specified as a numeric scalar.

example: 1000

data types: double

date and time data type, specified as one of these values.

valuedescription
'' (default)return date and time values as matlab date numbers.
'datetime'return date and time values as a datetime array.

you can specify these values using a character vector or string (for example, "datetime").

when you create a bpipe object, the bpipe function leaves this property unset. to retrieve data, you must set this property value manually at the command line or in a script using dot notation, for example:

c.datetimetype = 'datetime';
then, you can use these supported functions:
  • note

    if the datareturnformat property value is 'table' and the datetimetype property value is 'datetime', then the returned data is a table that contains date and time values as a datetime array. if the datareturnformat property value is an empty character vector, then setting the datetimetype property to 'datetime' returns date and time values for aggregated ticks and historical requests as matlab date numbers.

data return format, specified as one of these values, which determine the data type of the returned data.

valuedata type of returned data
'cell'cell array
'table'table
'timetable'timetable
'structure'structure

note

the default data type of the returned data depends on the executed function. to specify the default data type, set the datareturnformat property to ''. for default data types, see the supported function list.

you can specify these values using a character vector or string (for example, "table").

when you create a bpipe object, the bpipe function leaves this property unset. to retrieve data, you must set this property value manually at the command line or in a script using dot notation, for example:

c.datareturnformat = 'structure';
then, you can use these supported functions.
supported functionvalid data types for returned data
  • cell array (default)

  • structure

  • table

  • cell array (default)

  • structure

  • table

  • cell array (default)

  • structure

  • table

  • cell array (default)

  • structure

  • table

  • structure (default)

  • table

  • structure (default)

  • table

  • structure (default)

  • table

  • timetable

  • structure (default)

  • table

  • timetable

  • numeric array (default)

  • table

  • timetable

  • structure (default)

  • table

  • timetable

  • cell array (default for raw tick data)

  • numeric array (default for interval tick data)

  • table

  • timetable

note

regardless of the datetimetype property value, if the datareturnformat property value is 'timetable', then the getdata and getbulkdata functions return a table that contains date and time values as datetime arrays.

object functions

close bloomberg connection v3
properties of bloomberg connection v3
determine bloomberg connection v3
equity screening data for bloomberg connection v3
bulk data with header information for bloomberg connection v3
current data for bloomberg connection v3
historical data for bloomberg connection v3
current portfolio data for bloomberg connection v3
real-time data for bloomberg connection v3
unsubscribe real-time requests for bloomberg connection v3
historical technical analysis for bloomberg connection v3
intraday tick data for bloomberg connection v3
field category search for bloomberg connection v3
field information for bloomberg connection v3
field search for bloomberg connection v3
find information about securities for bloomberg connection v3

examples

create a bloomberg b-pipe connection using the ip address of the machine running the bloomberg b-pipe process. this example assumes the following:

  • the authentication is windows authentication when you set authtype to 'os_logon'.

  • the application name is blank because you are not connecting to bloomberg b-pipe using an application.

  • the ip address for the machine running the bloomberg b-pipe process is '111.11.11.112'.

  • the port number of the machine running the bloomberg b-pipe process is 8194.

authtype = 'os_logon';
appname = '';
ipaddress = {'111.11.11.112'};
port = 8194;
c = bpipe(authtype,appname,ipaddress,port)
c = 
  bpipe with properties:
         appauthtype: ''
            authtype: 'os_logon'
             appname: []
                user: [1x1 com.bloomberglp.blpapi.impl.at]
             session: [1x1 com.bloomberglp.blpapi.session]
           ipaddress: {'111.11.11.112'}
                port: 8194.00
             timeout: 0
        datetimetype: ''
    datareturnformat: ''

bpipe connects to the machine running bloomberg b-pipe at port number 8194. bpipe creates the bloomberg b-pipe connection object c with these properties:

  • application authentication type

  • bloomberg user authentication type

  • application name

  • bloomberg user identity object

  • bloomberg v3 api session object

  • ip address of the machine running the bloomberg b-pipe process

  • port number of the machine running the bloomberg b-pipe process

  • number (in milliseconds) specifying how long matlab attempts to connect to the machine before timing out

  • date and time data type

  • data return format

request the last and open prices for microsoft®.

format bank  % display data format for currency
s = 'msft us equity';
f = {'last_price';'open'};
[d,sec] = getdata(c,s,f)
d = 
    last_price: 33.34
          open: 33.60
sec = 
    'msft us equity'

getdata returns a structure d with the last and open prices. also, getdata returns the name of the security in sec.

close the bloomberg b-pipe connection.

close(c)

create a bloomberg b-pipe connection using the ip address of the machine running the bloomberg b-pipe process. this example assumes the following:

  • the authentication is windows authentication when you set authtype to 'os_logon'.

  • the application name is blank because you are not connecting to bloomberg b-pipe using an application.

  • the ip address for the machine running the bloomberg b-pipe process is '111.11.11.112'.

  • the port number of the machine running the bloomberg b-pipe process is 8194.

  • the timeout value is 1000 milliseconds.

authtype = 'os_logon';
appname = '';
ipaddress = {'111.11.11.112'};
port = 8194;
timeout = 1000;
c = bpipe(authtype,appname,ipaddress,port,timeout)
c = 
  bpipe with properties:
         appauthtype: ''
            authtype: 'os_logon'
             appname: []
                user: [1x1 com.bloomberglp.blpapi.impl.at]
             session: [1x1 com.bloomberglp.blpapi.session]
           ipaddress: {'172.28.17.118'}
                port: 8194.00
             timeout: 1000.00
        datetimetype: ''
    datareturnformat: ''

bpipe connects to the machine running bloomberg b-pipe at port number 8194. bpipe creates the bloomberg b-pipe connection object c with these properties:

  • application authentication type

  • bloomberg user authentication type

  • application name

  • bloomberg user identity object

  • bloomberg v3 api session object

  • ip address of the machine running the bloomberg b-pipe process

  • port number of the machine running the bloomberg b-pipe process

  • number (in milliseconds) specifying how long matlab attempts to connect to the machine before timing out

  • date and time data type

  • data return format

request the last and open prices for microsoft.

format bank  % display data format for currency
s = 'msft us equity';
f = {'last_price';'open'};
[d,sec] = getdata(c,s,f)
d = 
    last_price: 33.34
          open: 33.60
sec = 
    'msft us equity'

getdata returns a structure d with the last and open prices. also, getdata returns the name of the security in sec.

close the bloomberg b-pipe connection.

close(c)

create a bloomberg b-pipe zero-footprint connection using the ip address of the machine running the bloomberg b-pipe process. this example assumes the following:

  • the authentication is based on the application name when you set authtype to 'application_only'.

  • the application name is 'app'.

  • the ip address for the machine running the bloomberg b-pipe process is '111.11.11.112'.

  • the port number of the machine running the bloomberg b-pipe process is 8194.

  • the number (in milliseconds) specifying how long matlab attempts to connect to the machine before timing out is 1000.

  • the full path of the credentials file is c:\abcdefg.pk12.

  • the b-pipe password is 12345.

  • the full path of the trust file is c:\hijklm.pk7.

authtype = 'application_only';
appname = 'app';
ipaddress = {'111.11.11.112'};
port = 8194;
timeout = 1000;
tlscred = 'c:\abcdefg.pk12';
tlspassword = '12345';
tlstrust = 'c:\hijklm.pk7';
c = bpipe(authtype,appname,ipaddress,port, ...
    timeout,tlscred,tlspassword,tlstrust)
c = 
  bpipe with properties:
         appauthtype: 'appname_and_key'
            authtype: 'application_only'
             appname: 'app'
                user: [1x1 com.bloomberglp.blpapi.impl.by]
             session: [1x1 com.bloomberglp.blpapi.session]
           ipaddress: {'111.11.11.112'}
                port: 8194.00
             timeout: 1000.00
        datetimetype: ''
    datareturnformat: ''

bpipe connects to the machine running bloomberg b-pipe at port number 8194. the bpipe function creates the bloomberg b-pipe connection object c with these properties:

  • application authentication type

  • bloomberg user authentication type

  • application name

  • bloomberg user identity object

  • bloomberg v3 api session object

  • ip address of the machine running the bloomberg b-pipe process

  • port number of the machine running the bloomberg b-pipe process

  • number (in milliseconds) specifying how long matlab attempts to connect to the machine before timing out

  • date and time data type

  • data return format

request the last and open prices for microsoft.

format bank  % display data format for currency
s = 'msft us equity';
f = {'last_price';'open'};
[d,sec] = getdata(c,s,f)
d = 
    last_price: 33.34
          open: 33.60
sec = 
    'msft us equity'

getdata returns a structure d with the last and open prices. also, getdata returns the name of the security in sec.

close the bloomberg b-pipe connection.

close(c)

version history

introduced in r2014b

see also

topics

    网站地图