这就是我想要做的。
我使用Rbbg和BDH功能从bloomberg下载了每月CDS点差数据
require(Rbbg)
bloomberg.connect <- blpConnect(verbose=FALSE)
tickers.list <- c("MEX CDS USD SR 5Y Corp")
bloomberg.dump <- bdh(bloomberg.connect,
tickers.list,
"PX_LAST",
"20000101",
"",
always.display.tickers = TRUE,
option_names = "periodicitySelection",
option_values = "MONTHLY")
这很有效 - 没问题。
现在,我想使用传播数据和日期作为输入,为创建的数据集的每一行运行BDP函数:
securities <- c("SP2A13DX Corp")
fields <- c("CDS QUOTED PRICE","SW_NET_ACC_INT")
override_fields <- c("SW_SPREAD",
"CDS FLAT SPREAD",
"CDS_CALCULATION_MODEL",
"CDS CONTRACT TYPE",
"SW PAY CURVE NUM",
"CDS RR",
"SW EFF DT",
"MATURITY",
"SW_CURVE_DT",
"SW_PAY_NOTL_AMT")
overrides <- c("100",
bloomberg.dump$PX_LAST,
"I",
"W",
"260",
"0.4",
bloomberg.dump$date,
bloomberg.dump$date,
bloomberg.dump$date,
"1000000")
d <- bdp(bloomberg.connect, securities, fields, override_fields, overrides)
不幸的是,这不起作用。我应该循环吗?我知道有更有效的方法来解决这个问题。提前感谢任何指导
答案 0 :(得分:0)
您使用的大多数字段覆盖仅通过API提供当前值,因此无法获取历史数据。