You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在BLP Bloomberg API封装包中配置计价货币覆盖实现资产转USD?

解决BLP包中转换FUND_TOTAL_ASSETS为USD的问题

正确配置方式

Excel BDH函数里的FX=USD参数,对应Bloomberg API中的定价货币选项,而非override字段。在BLP包中需要通过pricing_options参数传递,而非overrides:

import datetime as dt

xf = bquery.bdh(
    securities=search,
    fields=['FUND_TOTAL_ASSETS'],
    start_date=dt.date(2022,10,1).strftime("%Y%m%d"),
    end_date=dt.datetime.now().date().strftime("%Y%m%d"),
    pricing_options=[('currency', 'USD')]
)

部分版本的BLP包支持直接传入currency参数作为简化写法:

xf = bquery.bdh(
    securities=search,
    fields=['FUND_TOTAL_ASSETS'],
    start_date=dt.date(2022,10,1).strftime("%Y%m%d"),
    end_date=dt.datetime.now().date().strftime("%Y%m%d"),
    currency='USD'
)

为什么之前的配置无效

  • 用overrides=[('currency','USD')]无效:overrides用于覆盖证券的固有属性字段(如发行条款类字段),而计价货币是查询的全局定价选项,不属于override范畴。
  • 用('FX','USD')报错:FX不是Bloomberg API认可的override字段名,因此触发INVALID_OVERRIDE_FIELD错误。

配置后,查询返回的FUND_TOTAL_ASSETS字段值会自动转换为USD计价,与Excel BDH函数中FX=USD参数的效果一致。

内容的提问来源于stack exchange,提问作者user3556757

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 21:30:24