交易时间撤单模块 [金字塔]
- 咨询内容:
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 - 金字塔客服: 如果不是交易时间 三所和中金冲突 如果账户内有中金和3所单子 在小节休息时会有所影响 希望这帖子帮到大家
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容