如何使用ETFAttributesProvider和FundConstituentsProvider查询ETF基金的申购赎回清单信息?
使用ETFAttributesProvider
查询ETF基金的基本信息,具体用法见示例一:
示例1:使用ETFAttributesProvider查询ETF基金的基本信息
using guosen;
vars:
ETFAttributesProvider EAP(null),
string sym("510051.SH");
method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
begin
EAP = new ETFAttributesProvider;
EAP.Symbol = sym;
EAP.StateChanged += EAP_StateChanged;
EAP.Load = TRUE;
end;
Method void EAP_StateChanged(elsystem.object sender,tsdata.common.StateChangedEventArgs args)
Begin
if(args.NewState = tsdata.common.DataState.loaded)then
Begin
print("一级市场代码:",EAP.Symbol);
print("现金替代比例上限:",EAP.CashAlterCeiling);
print("现金差额(元):",EAP.CashBalance);
print("预估现金(元):",EAP.EstMinPurRdmCash);
print("是否公布IOPV:",EAP.IOPVFlag);
print("最小申购、赎回单位净值(元):",EAP.MinPurRdmNetWorth);
print("最小申购、赎回单位:",EAP.MinPurRdmUnit);
print("基金份额净值:",EAP.NetWorthPerUnit);
print("申购上限:",EAP.PurchaseCeiling);
print("申购赎回状态:",EAP.PurRdmFlag.ToString());
print("赎回上限:",EAP.RedeemCeiling);
End;
End;
//打印输出栏示例:
//一级市场代码:510051.SH
//现金替代比例上限: 0.50
//现金差额(元):12475.59
//预估现金(元):14170.59
//是否公布IOPV: TRUE
//最小申购、赎回单位净值(元):2439092.59
//最小申购、赎回单位:900000.00
//基金份额净值: 2.71
//申购上限: 0.00
//申购赎回状态:purchaseredeem
//赎回上限: 0.00
使用FundConstituentsProvide
查询ETF基金的基本信息,具体用法见示例一:
示例2:使用FundConstituentsProvide查询ETF基金的申购赎回清单
using guosen;
vars:
FundConstituentsProvider FCP(null),
string sym("510051.SH");
method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
begin
FCP = new FundConstituentsProvider;
FCP.Symbol = sym;
FCP.StateChanged += FCP_StateChanged;
FCP.Load = TRUE;
end;
Method void FCP_StateChanged(elsystem.object sender,tsdata.common.StateChangedEventArgs args)
vars:int loop;
Begin
if(args.NewState = tsdata.common.DataState.loaded)then
Begin
For loop = 0 to FCP.Count-1
Begin
print(loop + 1,"现金替代标志->",FCP[loop].CashInsteadFlag.ToString());
print(loop + 1,"现金替代溢价比率->",FCP[loop].CashInsteadOverRate);
print(loop + 1,"名称->",FCP[loop].Description);
print(loop + 1,"市场->",FCP[loop].Market);
print(loop + 1,"申购现金替代数量->",FCP[loop].PurCashInsteadAmount);
print(loop + 1,"数量->",FCP[loop].Quantity);
print(loop + 1,"赎回现金替代数量->",FCP[loop].RdmCashInsteadAmount);
print(loop + 1,"代码->",FCP[loop].Symbol);
print();
End;
End;
End;
//打印输出示例:
//1 现金替代标志->allowed
//1 现金替代溢价比率-> 0.10
//1 名称->浦发银行
//1 市场->SH
//1 申购现金替代数量-> 0.00
//1 数量->6000.00
//1 赎回现金替代数量-> 0.00
//1 代码->600000.SH
//2 现金替代标志->allowed
//2 现金替代溢价比率-> 0.10
//2 名称->民生银行
//2 市场->SH
//2 申购现金替代数量-> 0.00
//2 数量->12000.00
//2 赎回现金替代数量-> 0.00
//2 代码->600016.SH
//...