StocksDA
简述
计算当前板块的板块对大盘涨跌贡献值。
(1)RightType=0时,为“总股本加权”的加权方法;
(2)RightType=1时,为“流通股本加权”的加权方法。
(3)板块对大盘涨跌贡献值的算法:DA=(VC-PC)*IC/MC
VC:板块在EndT的市值;
PC:板块在BegT的市值;
IC:基准指数在EndT的收盘;
MC:基准板块在BegT的市值;
StocksDA(StockArr:Array;BegT:TDateTime;EndT:TDateTime;RightType:Integer;IndexId:String;MarketName:String):Real
名称 | 类型 | 说明 |
---|
StockArr | Array | 数组,股票列表; |
BegT | TDateTime | 日期,开始日期; |
EndT | TDateTime | 日期,截止日期; |
RightType | Integer | 整数,加权方法;
 |
IndexId | String | 基准指数; |
MarketName | String | 基准市场名称。 |
返回 | Real | 实数,当前板块的板块对大盘涨跌贡献值。 |
oV:=BackUpSystemParameters2();
//取'沪深300'在2011年1月1日至2011年12月31日的板块市值对大盘涨跌贡献值
//加权方式为'流通股本',市场名称为"上证A股;深证A股"
BegT:=inttodate(20110101);
EndT:=inttodate(20111231);
bk:=getbkbydate('SH000300',inttodate(20111231));
Return StocksDA(bk,BegT,EndT,1,"SH000001","上证A股;深证A股");
//结果:-258.46。