分级基金数据

  • fenji.geta_by_yield(_current_yield, listing=True)
  • 通过传入当前的本期利率拿到对应的分级A的order_book_id list

参数:

  • current_yield (float) – 本期利率,用户必须指定
  • listing (bool) – 默认为True,该分级基金是否在交易所可交易返回:符合当前利率水平的分级A基金的order_book_id list;如果无符合内容,则返回空列表。Example:

拿到当前收益率为4的A基的代码列表:

  1. fenji.get_a_by_yield(4)
  2. #[Out]
  3. #['150039.XSHE']
  • fenji.geta_by_interest_rule(_interest_rule)
  • 通过传入当前的利率规则拿到对应的分级A的order_book_id list

参数:

  • interest_rule (str) – 利率规则,例如:”+3.5%”, “+4%”, “=7%”, “*1.4+0.55%”, “利差” etc. 您也可以在研究平台使用 fenji.get_all() 来进行查询所有的组合可能。用户必须填写
  • listing (bool) – 该分级基金是否在交易所可交易,默认为True返回:符合当前利率规则的分级A基金的order_book_id listExample:

拿到符合利率规则“+3%”的A基的代码列表:

  1. fenji.get_a_by_interest_rule("+3%")
  2. #[Out]
  3. #['502011.XSHG', '150215.XSHE', '150181.XSHE', '150269.XSHE', '150173.XSHE', '150217.XSHE', '502027.XSHG', '150255.XSHE', '150257.XSHE', '150237.XSHE', '150100.XSHE', '150177.XSHE', '502017.XSHG', '150279.XSHE', '150271.XSHE', '150051.XSHE', '150245.XSHE', '150233.XSHE', '502004.XSHG', '150200.XSHE', '150205.XSHE', '150184.XSHE', '502049.XSHG', '150207.XSHE', '150313.XSHE', '150243.XSHE', '150239.XSHE', '150273.XSHE', '150227.XSHE', '150076.XSHE', '150203.XSHE', '150209.XSHE', '150259.XSHE', '150315.XSHE', '150283.XSHE', '150241.XSHE', '150229.XSHE', '150307.XSHE', '150186.XSHE', '150231.XSHE', '502024.XSHG', '502007.XSHG', '150305.XSHE', '150018.XSHE', '150309.XSHE', '150311.XSHE', '150235.XSHE', '150143.XSHE', '150249.XSHE', '150329.XSHE', '150251.XSHE', '150169.XSHE', '150357.XSHE', '150194.XSHE', '150179.XSHE', '150164.XSHE', '150192.XSHE', '150171.XSHE', '150022.XSHE', '150275.XSHE', '150092.XSHE', '150277.XSHE']
  • fenji.getall(_field_list)
  • 获取所有分级基金信息

参数:field_list (list[str]) – 希望输出的数据字段名(见下表),默认为所有字段返回:pandas.DataFrame - 分级基金各项数据

fields字段名a_b_propotion分级A:分级B的比例conversion_date下次定折日creation_date创立日期current_yield本期利率expire_date到期日,可能为NaN - 即不存在fenji_a_order_book_idA基代码fenji_a_symbolA基名称fenji_b_order_book_idB基代码fenji_b_symbolB基名称fenji_mu_orderbook_id母基代码fenji_mu_symbol母基名称interest_rule利率规则next_yield下期利率track_index_symbol跟踪指数

Example:

  • 拿到所有的分级基金的信息:
  1. fenji.get_all()
  2. #[Out]
  3. #a_b_propotion conversion_date creation_date current_yield expire_date fenji_a_order_book_id fenji_a_symbol fenji_b_order_book_id fenji_b_symbol fenji_mu_orderbook_id fenji_mu_symbol interest_rule next_yield track_index_symbol
  4. #0 7:3 2016-11-19 2014-05-22 2.5 NaN 161828 永益A 150162.XSHE 永益B 161827 银华永益 +1% NaN 综合指数
  5. #1 1:1 2017-01-04 2015-03-17 5 NaN 150213.XSHE 成长A级 150214.XSHE 成长B级 161223 国投成长 +3.5% 5 创业成长
  6. #2 1:1 2016-12-15 2015-07-01 5.5 NaN 150335.XSHE 军工股A 150336.XSHE 军工股B 161628 融通军工 +4% 5.5 中证军工
  • 拿到只有2个字段的所有分级基金的信息:
  1. fenji.get_all(field_list = ['fenji_a_order_book_id', 'current_yield'])
  2. #[Out]
  3. #current_yield fenji_a_order_book_id
  4. #0 2.5 161828
  5. #1 5 150213.XSHE
  6. #2 5.5 150335.XSHE