Credits¶
(c) 2024 Marek Ozana
In [1]:
Copied!
from polars_bloomberg import BQuery
from polars_bloomberg import BQuery
Monthly Index Stats¶
In [2]:
Copied!
# Get data
query = """
let(
#oas_s=spread(spread_type=OAS_SWAP, universe_type=RETURNS);
#dOAS = diff(#oas_s);
#dur = duration(universe_type=RETURNS);
#ret = pct_diff(px_last());
)
get(name, #oas_s, #dOAS, #dur, #ret)
for(['LF98TRUU Index', 'LP01TREU Index', 'H38098EU Index'])
with(dates=range(-3M, 0D), fill=PREV, per=M)
"""
with BQuery() as bq:
df = bq.bql(query).combine()
# Get data
query = """
let(
#oas_s=spread(spread_type=OAS_SWAP, universe_type=RETURNS);
#dOAS = diff(#oas_s);
#dur = duration(universe_type=RETURNS);
#ret = pct_diff(px_last());
)
get(name, #oas_s, #dOAS, #dur, #ret)
for(['LF98TRUU Index', 'LP01TREU Index', 'H38098EU Index'])
with(dates=range(-3M, 0D), fill=PREV, per=M)
"""
with BQuery() as bq:
df = bq.bql(query).combine()
Out[3]:
oas | dOAS | dur | ret | |
---|---|---|---|---|
2024-10-31 | ||||
Bloomberg US Corporate High Yi | 313 | −7 | 3.00 | −0.54% |
Bloomberg Pan-European High Yi | 316 | −16 | 2.72 | 0.51% |
Bloomberg US and Euro High Yie | 310 | −11 | 2.98 | −0.36% |
2024-11-29 | ||||
Bloomberg US Corporate High Yi | 293 | −20 | 2.93 | 1.15% |
Bloomberg Pan-European High Yi | 323 | 7 | 2.72 | 0.75% |
Bloomberg US and Euro High Yie | 298 | −12 | 2.94 | 0.86% |
2024-12-24 | ||||
Bloomberg US Corporate High Yi | 308 | 16 | 3.08 | −0.59% |
Bloomberg Pan-European High Yi | 307 | −16 | 2.74 | 0.59% |
Bloomberg US and Euro High Yie | 301 | 3 | 3.04 | −0.32% |