将BDP公式转换为ti

2024-03-28 15:16:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我对Python还不熟悉。 我有这样一个BDP公式=BDP(bond, 'RTG_SP', "SETTLE_DT=20180426"),并试图将其转换为tia。你知道吗

当我使用LocalTerminal.get_historical(bond, 'RTG_SP', start='20180426', end='20180426')时,没有收到任何消息。 也许我应该使用LocalTerminal.get_reference(),但是我没有看到参数SETTLE_DT。 有没有办法从tia中获得价值?你知道吗

谢谢!你知道吗


Tags: 消息getdtbdpstartsp公式end
1条回答
网友
1楼 · 发布于 2024-03-28 15:16:42

RTG_SP不直接提供历史数据。您需要使用覆盖:

In[1]: from xbbg import blp

In[2]: blp.bdp('XS1627599654 Corp', 'RTG_SP')
Out[2]:
              ticker   field value
0  XS1627599654 Corp  RTG_SP     B

In[3]: blp.bdp('XS1627599654 Corp', 'RTG_SP', Rating_As_Of_Date_override='20180201')
Out[3]:
              ticker   field value
0  USG4863AAC20 Corp  RTG_SP   BB+

使用^{}演示

相关问题 更多 >