Hello! I'm trying to extract simultaneous observation from 11 financial series
Clear["Global`*"];
port = {"Thermo Fisher Scientific", "KLA-Tencor", "Air Liquide",
"Schneider Electric", "Silicon Motion",
"Compagnie de Saint-Gobain", "Groupe Fnac", "Pfizer",
"Schlumberger", "ArcelorMittal", "Valneva SE"};
Mois = 6;
Durée = 30 Mois;
début = DatePlus[DateList[], -Durée];
during 6 months.
ret = FinancialData[#, "Return", {début, Date[]}, "DateValue"] & /@
port;
These data were differently recorded: 122, 123 or 124 measures. Thus, in tried to resample them using common dates:
Map[#["PathLengths"] &, ret]
commonDates =
Intersection[Table[Flatten[ret[[i]]["Dates"]], {i, Length@ret}]] //
Flatten;
Length@%
Retours =
ParallelTable[
Select[ret[[i]]["DatePath"], MemberQ[commonDates, First@#] &], {i,
Length@ret}];
Retours =
ParallelTable[
Map[QuantityMagnitude@#[[2]] &, Retours[[i]]], {i, Length@Retours}];
Map[Length, Retours]
It does not work, since the length of "CommonDates" is 369 (=122+123+124). Nevertheless, I can see a lot of duplicates in this list, such as
DateObject[{2021, 8, 5, 0, 0, 0.}, "Instant", "Gregorian", 1.]
So, what is the problem? THanks a lot!
Claude