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.
When we use history we need to provide it the list of tickers we need to fetch, e.g.
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.
The results are stored in history's output "d" as a cell array for each security required:
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 个)

类别

Help CenterFile Exchange 中查找有关 Bloomberg Server 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by