function CancelAllOrder(sAccount) '撤销所有委托 Document.DebugFile "C:\OrderLog.Txt","撤单模块启动"& sAccount,1 dim Orderid '订单ID dim Filled '提交手数 dim Remaining '剩余手数 dim Action '买卖 dim OrderType '订单类型 dim LmtPrice '委托价 dim Account '账户 dim Kaiping '开平 dim code dim t1 t1=TimeValue(Now()) PendingCount=Order.OrderNum2 For i=0 to PendingCount-1 Call Order.OrderInfo2(i,OrderID,ConSign,Filled,Remaining,Action,OrderType,LmtPrice,Account,Kaiping,Code,Market) 'application.MsgOut sAccount & " ---"&OrderID &"---!!"&Code &"===="&Market Document.DebugFile "C:\OrderLog.Txt",sAccount & " ---"&OrderID &"---!!"&Code &"===="&Market,1 if Account=sAccount then if Market = "ZJ" and ((t1>TimeValue("09:10") and t1<TimeValue("11:30")) or (t1>TimeValue("13:00") and t1<TimeValue("15:15"))) then call order.CancelOrder(OrderID) Document.DebugFile "C:\OrderLog.Txt","中金盘中撤单"&Market,1 end if
if (Market ="SQ" or Market="DQ" or Market="ZQ") and ( (t1>TimeValue("09:00") and t1<TimeValue("10:15")) or (t1>TimeValue("10:30") and t1<TimeValue("11:30")) or (t1>TimeValue("13:30") and t1<TimeValue("15:00") ) ) then call order.CancelOrder(OrderID) Document.DebugFile "C:\OrderLog.Txt","三所盘中撤单"&Market,1 end if
if Market = "ZJ" and (t1>TimeValue("09:10") and t1<TimeValue("11:30")) or (t1>TimeValue("13:00") and t1<TimeValue("15:15")) then application.MsgOut "!!!!!!!!!!!!!!!!!!!!" 'Document.DebugFile "C:\OrderLog.Txt","!!!!!!!!!!!!!!!!!!!!",1 end if