以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 高级功能研发区 (http://www.weistock.com/bbs/list.asp?boardid=5) ---- 交易时间撤单模块 (http://www.weistock.com/bbs/dispbbs.asp?boardid=5&id=54545) |
-- 作者:rushtaotao -- 发布时间:2013/8/1 14:42:46 -- 交易时间撤单模块 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 end if Next End function |
-- 作者:rushtaotao -- 发布时间:2013/8/1 14:44:50 -- 如果不是交易时间 三所和中金冲突 如果账户内有中金和3所单子 在小节休息时会有所影响 希望这帖子帮到大家 |