Recipes¶
Short reference queries grouped by workflow. Each recipe has the query, the Python code that runs it and the output it printed.
For how bql() and combine() work, see BQL; for bdh(), see
BDH. For worked analyses with charts, see the Examples.
Workflows¶
-
New AT1, RT1 and Technology deals in the primary pipeline, and the pipeline by currency.
-
What dealers want to buy or sell: per bond, per dealer and per issuer, today and over 1 and 5 weeks, next to spreads.
-
Bank capital stacks, call schedules, distance to the AT1 trigger, debt by rank with leverage, and the CAST parent.
-
OAS per rating and the AT1 premium, monthly and daily spread history, index yield vs OAS, and YAS at any price.
-
From a bond to the company that reports: revenue, EBITDA, segments, bank CET1 and ROE, leverage per sector.
-
Weekly spreads, holiday calendars, fund flows, CDS basis, hedged yields, fiscal-year leverage and candles.
How to read a recipe¶
- Question: the heading and the line under it say what the recipe answers.
- Uses: the functions and options it shows.
- Code: copy it with the button and run it at a Bloomberg Terminal.
- Output: what it printed on the date at the top of the page.
- Watch out: traps that give wrong numbers, often without an error.
- Notes: how to read the output and adapt the query.
All recipes¶
New Issues¶
| Recipe | Uses |
|---|---|
| New AT1 / RT1 deals | INCLUDEPRELIMINARYSECURITIES, issuance_pricing, as #alias |
| New Technology deals | classification_name(BCLASS) |
| Pipeline by currency | count(group(...)) |
Dealer Axes¶
| Recipe | Uses |
|---|---|
| AT1 axes by bond | axes() |
| Large axes only | axes_by_dealer(), matches(), dropna() |
| Net axes per issuer | sum(group(..., ticker)) |
| Total axes: today, 1 week, 5 weeks | calc_interval, *_HIST_AGG_SIZE |
| Per bond: today vs 1 and 5 weeks | calc_interval, *_HIST_AGG_SIZE |
| Axes in a relative-value screen | flt_spread(), spread(spread_type=OAS) |
| Top 3 dealers | axes_by_dealer() |
Bonds and Capital Structure¶
| Recipe | Uses |
|---|---|
| Swedish bank capital stacks | normalized_payment_rank(), sum(group(..., [ticker, #rank])) |
| AT1 and Tier 2 call schedule | basel_iii_designation(), nxt_call_dt |
| AT1 distance to trigger | value(..., parent(type=CAST), mapby=LINEAGE), capital_type_coco_trigger_level() |
| Bonds and loans with leverage | loansUniv(ACTIVE), ebitda(fpt=LTM) |
| Direct, ultimate and CAST parent | parent(type=DIRECT), ULTIMATE, CAST |
| One capital structure, several issuers | group(..., [#cast, ticker, #rank]) |
| Largest capital structures in a high-yield index | sum(group(..., #cast)) over members() |
Spread Statistics¶
| Recipe | Uses |
|---|---|
| OAS by rating: AT1 vs other bonds | median(), quantile(), group(..., by=[bb_composite(), ...]) |
| Median OAS by rating, month by month | per=M, month(), year() |
| Daily average Z-spread of index members | avg(group(#s, by=#s().DATE)) |
| Index yield and spread, week by week | universe_type, per=W |
| Tier 2: spread to call or to maturity | YAS: spread(price=..., workout=...) |
| One bond at four prices | YAS: workout=TO_CUSTOM, workout_date |
| SEK AT1 floaters: discount margin | YAS: discount_margin(price=...) |
Company Fundamentals¶
| Recipe | Uses |
|---|---|
| From a bond to the company that reports | value(..., fundamentalticker, mapby=LINEAGE) |
| Annual revenue and EBITDA, last two years | fundamentalticker(...), fa_period_type=A, fa_period_offset=range(-1Y, 0Y) |
| Reported vs adjusted EBITDA | fa_adjusted=N / Y, fa_act_est_data=A |
| Revenue by product and by country | segments(..., hierarchy=PRODUCT), hierarchy=LOCATION |
| Swedish AT1 issuers: CET1 and ROE by quarter | bs_tier1_com_equity_ratio(), normalized_roe(), fpt=Q |
| How much of a high-yield index has fundamentals? | issuerOf vs parent(type=CAST) vs fundamentalticker |
| Median leverage per sector | median(group(..., classification_name(BCLASS, 3))) |
| Bloomberg Intelligence sector template | BSRCH: bsrch("BI:TPD", {"BIKEY": ...}) |
Market History with BDH¶
| Recipe | Uses |
|---|---|
| High-yield spreads, week by week | periodicitySelection=WEEKLY, INDEX_OAS_TSY_BP |
| Three markets, one calendar | nonTradingDayFillOption, nonTradingDayFillMethod |
| Fund NAV, assets and flows | FUND_TOTAL_ASSETS, FUND_FLOW, MONTHLY |
| CDS index vs intrinsic: the basis | CDS_INDEX_INTRINSIC_BASIS_VALUE |
| US Treasuries hedged into euros vs Bunds | FXHCEUUS Index, pivot(on="security") |
| Fiscal-year leverage | YEARLY, periodicityAdjustment=FISCAL, currency |
| Weekly candles | PX_OPEN, PX_HIGH, PX_LOW, WEEKLY |
Keeping outputs fresh
The outputs are pasted in by python dev/refresh_recipes.py, run at a
Bloomberg Terminal. See the developer guide.