pf_TrackingError
简述
组合-跟踪误差
pf_TrackingError(t1:Array,fName1:String,t2:Array,fName2:String):Float
t1:组合收益率序列
fName1:t1数组中,代表收益率序列的字段名(涨幅、收益率等)
t2:基准收益率序列
fName2:t2数组中,代表收益率序列的字段名(涨幅、收益率等)
返回:实数
算法:
,即组合收益率与基准收益率之差的标准差
范例:
//此处以浦发银行收益率序列作为用户组合的收益率序列,基准为上证指数
stockid := 'SH600000';
IndexId := 'SH000001';
BegT := inttodate(20110101);
EndT := inttodate(20110630);
setsysparam(pn_date(),EndT);
n := tradedays(begt,endt);
t := nday(n,'日期',sp_time(),'涨幅1',spec(StockZf3(),stockid),'涨幅2',spec(StockZf3(),IndexId));
return pf_TrackingError(t,'涨幅1',t,'涨幅2');
//返回结果:1.13