天软金融分析.NET函数大全 > 金融函数 > 行情 > 区间

StockExtraZf    

简述

区间超额收益率(%)=股票收益率(%)-指数收益率(%)(已复权)
定义
StockExtraZf(BegT:TDateTime;EndT:TDateTime; IndexId:String; Type:  Integer): Real;
参数
名称类型说明
BegTTDateTime日期类型,开始日期
EndTTDateTime日期类型,截止日期
IndexIdString字符串类型,指数代码
Type  Integer整数类型,收益率计算方法
Type的值 收益率计算方法
0 涨幅(%)
1 对数收益率(%)
返回 Real
实数
  • 范例


    //A:返回SZ000002(万科A)相对于上证指数从20110801到20110901的区间超额收益率(%) :收益率计算方法为涨幅(%)
    SetSysParam(PN_Stock(),'SZ000002');
    BegT:=inttodate(20110801);
    EndT:=inttodate(20110901);
    return StockExtraZf(BegT,EndT,'SH000001',0); 
    //结果:5.2697

    //B:返回SZ000002(万科A)相对于上证指数从20110801到20110901的区间超额收益率(%) :收益率计算方法为对数收益率(%)
    SetSysParam(PN_Stock(),'SZ000002');
    BegT:=inttodate(20110801);
    EndT:=inttodate(20110901);
    return StockExtraZf(BegT,EndT,'SH000001',1); 
    //结果:5.2696
相关