Borrar filtros
Borrar filtros

Ticker change in Bloomberg generate errors in "history" download function

2 visualizaciones (últimos 30 días)
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??

Respuestas (0)

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by