MF_GetBenchmarketRate
简述
获取基准收益率(%)矩阵,支持多个券合成基准
MF_GetBenchmarketRate(IndexID:IndexList;BegT:Date;EndT:Date;ReturnMethod:UserDefine):Array
名称 | 类型 | 说明 |
---|
IndexID | IndexList | 指数,基准代码 若为字符串,则直接返回该基准的收益率序列 若为数组,则利用数组成分券等权重合成; 需要采用自定义权重合成,则字段必须包含代码、比例(%), |
BegT | Date | 日期,开始日 |
EndT | Date | 日期,截止日 |
ReturnMethod | UserDefine | 用户自定义,计算收益率的方法
|
返回 | Array | array,获取基准收益率(%)矩阵。其中,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);
返回:
