Ticker change in Bloomberg generate errors in "history" download function
1 次查看(过去 30 天)
显示 更早的评论
Good morning everyone,
I have to download historical and static financial data from Bloomberg, and of course I use the functions history and getdata, respectively.
In particular, the financial data I have to download and treat are equities prices, volumes, market cap etc. etc.
As you know, Bloomberg has specific functions to retrieve those data; in particular, every security has its "ticker", i.e. the "nickname" of the asset within Bloomberg.
d = history(c,s,f,fromdate,todate)
where "s" is the security-list in the form of a cell-array of chars:
s = {'TIZIO US Equity', 'CAIO US Equity', 'SEMPRONIO US Equity'}. % -1-
... the result of such a run is a cell array that contains the historical datas required in the "f" parameters, where "f" stands for "Bloomberg Function", such as:
f = {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} % ... and so on. % -2-
I get these datas directly from a long list of tickers within an excel file, and then I feed them directly in history.
d =
{dates x f} % historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'TIZIO US EQUITY'
{dates x f} % historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'CAIO US EQUITY'
{dates x f} % historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'SEMPRONIO US EQUITY'
The problem arises when a ticker is "wrong", which means that those tickers do not refer to a company's historical data; sometimes this happens because a certain company changes its ticker (e.g. 'DWDP US Equity' changed into 'DD US Equity'). In such case (suppose 'CAIO US EQUITY' becomes 'CO US Equity'), when I call history on s = {'TIZIO US Equity', 'CAIO US Equity', 'SEMPRONIO US Equity'}, the result will be
d =
{dates x f} % historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'TIZIO US EQUITY'
{0 x 0} % EMPTY historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'CO US EQUITY'
{dates x f} % historical {'PX_LAST', 'PX_OPEN', 'PX_VOLUME', 'TURNOVER'} for 'SEMPRONIO US EQUITY'
... and of course this generates errors when you try to manipulate these datas.
How can I detect and correct authomatically a change in the ticker of an asset from Bloomberg, in order to avoid such errors and throw warnings??
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bloomberg Server 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!