How can I place the realtime data retrieved from Bloomberg in the base workspace using Datafeed Toolbox 3.5 (R2010a)?

1 次查看(过去 30 天)

采纳的回答

MathWorks Support Team
[SL,T] = realtime(C,S,F,API) subscribes to a given security or list of securities S requesting the fields F and runs the specified function by API. It returns the subscription list, SL and the timer T associated with the real time callback for the subscription list.
The following callback (may be replaced by API above) will return the realtime data retrieved from Bloomberg to MATLAB's base workspace.
Create a new file, copy the function below and save it in the current folder.
function samplecallback(d,s)
%SAMPLECALLBACK Datafeed Toolbox Bloomberg realtime example.
% SAMPLECALLBACK (D,S) demonstrates the Datafeed Toolbox Bloomberg V3
% security realtime data import functionality. D is the structure
% containing the real time data and S is the security ID returned as the
% topic of the processed message.
%Process ticks
if isempty(d)
return
end
d.SEC = s;
assignin('base','A',d)
%
end
You can use the following code snippet to make use of this callback with BLP.REALTIME:
b = blp
[s,t] = realtime(b,ticker,fields,'samplecallback')
openvar('A')
Please replace ticker and fields with list of securities and desired fields respectively. Executing the above shall create the variable A in the base workspace (based on the data retrieved realtime) and open it in the variable editor.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Bloomberg B-PIPE 的更多信息

标签

产品


版本

R2010a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by