setsysparam(pn_stock(),'OF003741');
t:= select ['截止日'],['单位净值'],['累计净值'],
FundNAWZf4(inttodate(['截止日'])) as '日收益率(%)'
from infotable 328 of DefaultStockID()
where ['截止日']>=20170222 end;
t[:,'修正收益率(%)']:=t[:,'日收益率(%)'];
t[0,'后复权-单位净值']:=t[0,'单位净值'];
for i:=1 to length(t)-1 do
begin
if t[i,'修正收益率(%)']>=10 then
t[i,'修正收益率(%)']:=spec(stockzf4(inttodate(t[i,'截止日'])),'CSIH11009');
//mean(t[i-6:i-1,'修正收益率(%)']);//最近5日平均
//spec(stockzf4(inttodate(t[i,'截止日'])),'CSIH11009'); //或用当日业绩基准的
t[i,'后复权-单位净值']:=t[i-1,'后复权-单位净值']*(1+t[i,'修正收益率(%)']/100);
end
return t;