Bloomberg - Matlab connection, multiple securities: balanced sample

9 次查看(过去 30 天)
Hello,
how do I import multiple securities into a single timetable environment. Now it gives me basically a cell arry structure of 3 timetables:
c=blp;
s={'USBEGDPF Index';'EUBEGDPF Index';'JPBEGDPF Index'};
f={'LAST_PRICE'};
fromdate='01/31/1995';
todate='03/30/2020';
period='quarterly';
c.DataReturnFormat = 'timetable';
[d,sec]=history(c,s,f,fromdate,todate);
I would like to have them in one timetable, and also be able to include a time series which may have NANs.
Many thanks,
Bjoern

回答(1 个)

Tejas
Tejas 2024-10-24,4:07
Hello Bjoern,
To create a timetable that includes data for multiple securities, the 'synchronize' function can be used to combine multiple timetables into one. For more details on how this function works, refer to this documentation: https://www.mathworks.com/help/matlab/ref/timetable.synchronize.html.
Here are the steps to use this function:
  • Start by initializing a variable named 'combinedTimetable' to store the combined timetable data.
[d,sec]=history(c,s,f,fromdate,todate);
combinedTimetable = d{1};
  • Use the 'synchronize' function to concatenate the timetable data.
for i = 2:length(d)
combinedTimetable = synchronize(combinedTimetable, d{i}, 'union');
end

类别

Help CenterFile Exchange 中查找有关 Bloomberg Desktop 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by