Python:findatapy从Bloomberg导入索引数据的成员

时间:2021-08-18 12:38:08

I am using the python library findatapy to import data from Bloomberg. I want to import the Members of an index(INDX_MEMBERS).

我正在使用python库findatapy从Bloomberg导入数据。我想导入索引的成员(INDX_MEMBERS)。

I did some test with others fields and others securities like equity and PX_LAST and it seems that the index is the problem.

我做了一些测试与其他领域和其他证券如股票和PX_LAST,似乎索引是问题。

My code :

我的代码:

from findatapy.util import SwimPool; SwimPool()
from findatapy.market import Market, MarketDataRequest, MarketDataGenerator

market = Market(market_data_generator=MarketDataGenerator())

md_request = MarketDataRequest(start_date='22 Mar 2018',data_source='bloomberg',
                               tickers =['S&P/TSX60 Index'],vendor_tickers =['SPTSX60 Index'],
                               fields=['INDX_MEMBERS'])                               
df = market.fetch_market(md_request)

the error :

错误 :

findatapy.market.ioengine - WARNING - Couldn't push MarketDataRequest_373__abstract_curve_key-None__category-None__category_key-backtest_default-cat_bloomberg_daily_NYC__cut-NYC__data_source-bloomberg__environment-backtest__expiry_date-NaT__fields-close__finish_date-2017-04-06
00:00:00__freq-daily__freq_mult-1__gran_freq-None__start_date-2017-01-01 
00:00:00__tickers-test US__trade_side-trade__vendor_fields-PX_LAST__vendor_tickers-SPTSX60 Index to Redis: Error 10061 connecting to 127.0.0.1:6379.
No connection could be made because the target machine actively refused it.

1 个解决方案

#1


0  

  1. Please use 'SPTSX60 Index' instead of 'S&P/TSX60 Index'.

    请使用'SPTSX60 Index'代替'S&P / TSX60 Index'。

  2. Please specify what is start_date='22 Mar 2018'? are you trying to pull the index members asof a given date? or the current members? INDX_MEMBERS is not a Historical field.

    请说明start_date ='201 201年3月'是什么?你是否试图在给定日期拉动索引成员?还是现在的会员? INDX_MEMBERS不是历史字段。

  3. As a suggestion, please use INDX_MWEIGHT_HIST field instead of INDX_MEMBERS, and optionally with END_DATE_OVERRIDE=20180322 (or other day in the past if that is what you are trying to achieve)

    作为建议,请使用INDX_MWEIGHT_HIST字段而不是INDX_MEMBERS,并可选择使用END_DATE_OVERRIDE = 20180322(或者过去的其他日期,如果这是您要实现的目标)

#1


0  

  1. Please use 'SPTSX60 Index' instead of 'S&P/TSX60 Index'.

    请使用'SPTSX60 Index'代替'S&P / TSX60 Index'。

  2. Please specify what is start_date='22 Mar 2018'? are you trying to pull the index members asof a given date? or the current members? INDX_MEMBERS is not a Historical field.

    请说明start_date ='201 201年3月'是什么?你是否试图在给定日期拉动索引成员?还是现在的会员? INDX_MEMBERS不是历史字段。

  3. As a suggestion, please use INDX_MWEIGHT_HIST field instead of INDX_MEMBERS, and optionally with END_DATE_OVERRIDE=20180322 (or other day in the past if that is what you are trying to achieve)

    作为建议,请使用INDX_MWEIGHT_HIST字段而不是INDX_MEMBERS,并可选择使用END_DATE_OVERRIDE = 20180322(或者过去的其他日期,如果这是您要实现的目标)