function TSDN_getIndexETFsAmountByEndt(index,endt);
begin
{
说明:获取指数在指定日对应的ETF实时累积的成交金额数据
按三秒线统计
参数:
index:string 指数代码,多个代码用分号隔开
endt:date 指定日期
返回:数组,单个指数返回列表数据,多个指数按下标给出多个指数列表数据
}
OV:=BackupSystemParameters2();
SetSysParam(pn_cycle(),cy_3s());
indexs:=str2array(index);
stocks:=select ["StockID"],["交易代码"],["标的指数代码"]
from infotable 302 of FundOperateFundsbyBkname("ETF",endt)
where ["标的指数代码"] in indexs end;
r:=array();
for i,code in indexs do
begin
stockarr:=sselect ["交易代码"] from stocks where ["标的指数代码"]=code end;
data:=select datetimetostr(["date"]) as "date",["sectional_amount"] from
markettable datekey endt to endt+18/24 of stockarr end;
r[code]:=select ["date"],sumof(["sectional_amount"]) as "ETF累计成交金额" from data group by ["date"] end;
end
return length(r)=1?r[index]:r;
end