pf_GroupConcentrationRatio
简述
分类汇总集中度,pfData中按Groupby字段分类汇总后按市值字段排名,返回前N项的市值所占总市值的比例。
pf_GroupConcentrationRatio(PfData:array;N:integer;NetValue:real;GroupBy:String;t:integer):real
名称 | 类型 | 说明 |
---|
pfData | array | 数据表类型,组合持仓数据 |
N | integer | 整数,数据个数 |
NetValue | real | 实数,资产净值或股票市值 |
GroupBy | String | 字符串,汇总字段 |
t | integer | 分类汇总详情 |
返回 | real | 实数 |
s:=array;
s[0:1]['代码']:=array('SH600000','SH600028');
s[0:1]['市值']:=array(6000000,4000000);
s[0:1]['行业名称']:=array('测试01','测试02');
s[0:1]['比例(%)']:=array(60,40);
return pf_GroupConcentrationRatio(s,3,40000000,'行业名称',0);
//返回:100