天软金融分析.NET函数大全 > 金融函数 > 金融工程 > 因子研究 > 因子计算 > 数据获取 > 中间函数

MF_GetBenchmarketRate    

简述

  获取基准收益率(%)矩阵,支持多个券合成基准
定义
MF_GetBenchmarketRate(IndexID:IndexList;BegT:Date;EndT:Date;ReturnMethod:UserDefine):Array
参数
名称类型说明
IndexIDIndexList指数,基准代码    若为字符串,则直接返回该基准的收益率序列    若为数组,则利用数组成分券等权重合成;      需要采用自定义权重合成,则字段必须包含代码、比例(%),
BegTDate日期,开始日
EndTDate日期,截止日
ReturnMethodUserDefine用户自定义,计算收益率的方法
显示名 取值
对数收益法 0
涨幅法 1
返回Arrayarray,获取基准收益率(%)矩阵。其中,0列为日期序列,1列为基准收益率(%)序列
  • 范例

    范例1:单个指数作为基准
      IndexID := "SH000300";
      BegT := 20230801t;
      EndT := 20230901t;
      ReturnMethod := 1;//涨幅法
      return MF_GetBenchmarketRate(IndexID,BegT,EndT,ReturnMethod);
    返回:
    范例2:多个券合成基准
      IndexID := array("SZ00001","SH600000","SZ000002"); 
    BegT := 20230801t; 
    EndT := 20230901t; 
    ReturnMethod := 1;//涨幅法 
    return MF_GetBenchmarketRate(IndexID,BegT,EndT,ReturnMethod);

    返回:
相关