如何使用PartialFillInfoCollection查询Order的委托分笔成交明细?
使用PartialFillInfoCollection在OrderUpdatedEvent中可以获得部分成交明细信息。 具体用法见示例一。
示例1:使用QuotesProvider获得涨停价或跌停价
using guosen;
using elsystem;
using elsystem.collections;
using tsdata.common;
vars:OrdersProvider OP(null);
method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
begin
OP = new OrdersProvider;
OP.Realtime = TRUE;
OP.Updated += OP_Updated;
OP.Load = TRUE;
end;
Method void OP_Updated(elsystem.Object sender,OrderUpdatedEventArgs args)
vars:guosen.Order od,guosen.PartialFillInfoCollection PFC,int loop;
Begin
if(args.Order<>null)then
Begin
od = args.Order astype guosen.Order;
PFC = args.PartialFills astype PartialFillInfoCollection;
print("--------Begin------------");
for loop = 0 to PFC.Count-1
Begin
print("[",numtostr(loop+1,0),"]:",
numtostr(PFC[loop].FilledPrice,2)," ",
numtostr(PFC[loop].FilledQuantity,0)," ",
PFC[loop].FilledTime.ToString());
End;
print("---------End-------------",newline);
End;
End;
//打印语句输出栏结果示例:
//--------Begin------------
//[1]:14.08 500 2016/11/30 6:58:00
//[2]:14.08 250 2016/11/30 6:58:00
//---------End-------------