Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Order in combined financial time series

1 visualización (últimos 30 días)
Dominik
Dominik el 8 de Abr. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello,
I have the following problem:
I create a fts for each security and simply name it s1,s2,...,s30 just by the index k of the loop.
for k=1:z
prices_fts{1,k}=fints(prices_sort{1,k}(:,1),prices_sort{1,k}(:,2),['s' num2str(k)]);
end
So far so good.
Now I merge all fts to one.
all_fts=prices_fts{1,1};
for k=1:z
all_fts=merge(all_fts, prices_fts{1,k});
end
Here comes the problem: instead of sorting it straight from 1 to 30, the order of the single series in the merged series is 1,11,12,13,14,15,16,17,18,19,20,21,...,3,30,31. It's all sorted by the first number.
I didn't find anything about sorting it rigth. I am thankful if somebody can help me.
Dominik

Respuestas (1)

Leah
Leah el 8 de Abr. de 2013
I don't have the financial toolbox, so it's hard to know exactly what's going on. You can use orderfields and specify an array with the order you want.
It might work to merge all at once instead of in a loop, but it seems like the sort is happening inside merge.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by