Info
此问题已关闭。 请重新打开它进行编辑或回答。
Order in combined financial time series
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Leah
2013-4-8
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.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!