如何获取订单的成交时间?
每个Order对象中都包括OrderID,委托数量、委托方向、委托类型、输入时间、成交时间等信息,譬如在Order Updated Event 中输出Order的成交时间如下所示。
示例1:使用OrdersProvider获得委托成交时间
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;
print("OrderID:",od.OrderID," ,FilledTime: " + od.FilledTime.ToString());
End;
End;
//打印语句输出栏结果示例:
//OrderID:0-_410-0381-2205-9_20-1611-30_1-0395-6295 ,FilledTime: 2016-11-30 14:30:00