bpipe
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 Comparing Bloomberg Connections.
For details about Bloomberg connection requirements, see Data Server Connection Requirements. To ensure a successful Bloomberg connection, perform the required steps before executing
bpipe
. For details, see Installing Bloomberg and Configuring Connections.
Creation
Syntax
Description
c = bpipe(authtype,appname,ipaddress,port)
creates a
Bloomberg
B-PIPE connection object c
, and sets these properties:
c = bpipe(authtype,appname,ipaddress,port,timeout,
connects to a B-PIPE zero-footprint cloud solution using the specified credentials
file, password, and trust file.tlscred
,tlspassword
,tlstrust
)
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
tlscred
— Credentials file
character vector | string scalar
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
tlspassword
— B-PIPE password
character vector | string scalar
B-PIPE password, specified as a character vector or string scalar. To obtain your B-PIPE password, contact Bloomberg.
Data Types: char
| string
tlstrust
— Trust file
character vector | string scalar
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
AppAuthType
— Application authentication type
""
(default) | "APPNAME_AND_KEY"
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
AuthType
— Bloomberg user authentication type
"OS_LOGON"
| "APPLICATION_ONLY"
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 <GO> option from the Bloomberg terminal.
AppName
— Application name
character vector | string
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
User
— Bloomberg user
Bloomberg user identity object
This property is read-only.
Bloomberg user, specified as a Bloomberg user identity object.
Example: [1x1
com.bloomberglp.blpapi.impl.aT]
Session
— Bloomberg V3 session
Bloomberg V3 API Session object
This property is read-only.
Bloomberg V3 session, specified as a Bloomberg V3 API Session object.
Example: [1x1 com.bloomberglp.blpapi.Session]
IPAddress
— IP address
character vector | cell array of character vectors | string | string array
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
— Port number
[]
(default) | numeric scalar
Port number of the machine running the Bloomberg B-PIPE process, specified as a numeric scalar.
Example: 8194
Data Types: double
TimeOut
— Timeout
numeric scalar
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
DatetimeType
— Date and time data type
''
(default) | 'datetime'
Date and time data type, specified as one of these values.
Value | Description |
---|---|
'' (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';
Note
If the
DataReturnFormat
property value is'table'
and theDatetimeType
property value is'datetime'
, then the returned data is a table that contains date and time values as adatetime
array. If theDataReturnFormat
property value is an empty character vector, then setting theDatetimeType
property to'datetime'
returns date and time values for aggregated ticks and historical requests as MATLAB date numbers.
DataReturnFormat
— Data return format
'cell'
| 'structure'
| 'table'
| 'timetable'
Data return format, specified as one of these values, which determine the data type of the returned data.
Value | Data 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';
Supported Function | Valid Data Types for Returned Data |
---|---|
category |
|
eqs |
|
fieldinfo |
|
fieldsearch |
|
lookup |
|
portfolio |
|
getbulkdata |
|
getdata |
|
history |
|
tahistory |
|
timeseries |
|
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
Bloomberg B-PIPE Connection
close | Close Bloomberg connection V3 |
get | Properties of Bloomberg connection V3 |
isconnection | Determine Bloomberg connection V3 |
Bloomberg B-PIPE Data Retrieval
eqs | Equity screening data for Bloomberg connection V3 |
getbulkdata | Bulk data with header information for Bloomberg connection V3 |
getdata | Current data for Bloomberg connection V3 |
history | Historical data for Bloomberg connection V3 |
portfolio | Current portfolio data for Bloomberg connection V3 |
realtime | Real-time data for Bloomberg connection V3 |
stop | Unsubscribe real-time requests for Bloomberg connection V3 |
tahistory | Historical technical analysis for Bloomberg connection V3 |
timeseries | Intraday tick data for Bloomberg connection V3 |
Bloomberg B-PIPE Data Information
category | Field category search for Bloomberg connection V3 |
fieldinfo | Field information for Bloomberg connection V3 |
fieldsearch | Field search for Bloomberg connection V3 |
lookup | Find information about securities for Bloomberg connection V3 |
Examples
Create Bloomberg B-PIPE Connection
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 Bloomberg B-PIPE Connection with Timeout
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 Bloomberg B-PIPE Zero-Footprint Connection
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)