Bloomberg - Matlab connection, multiple securities: balanced sample

1 Ansicht (letzte 30 Tage)
Bjoern van Roye
Bjoern van Roye am 17 Jun. 2020
Beantwortet: Tejas am 24 Okt. 2024
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

Antworten (1)

Tejas
Tejas am 24 Okt. 2024
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

Kategorien

Mehr zu Bloomberg Desktop finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by