\'单击确认按钮之后确认跟单方向
Sub CoVer_CommandButton1_Click()
if CoVer_ComboBox1.value = 0 then
FX = 0
ss = CoVer_textbox1.text
CoVer_Label2.caption = "正向跟单已确认 可点击最小化 " & " 跟踪手数为: " & ss
end if
if CoVer_ComboBox1.value = 1 then
FX = 1
ss = CoVer_textbox1.text
CoVer_Label2.caption = "反向跟单已确认 可点击最小化" & " 跟踪手数为: " & ss
end if
CoVer.minbutton =true
End Sub
\'利用金字塔强大的order对象对每笔回报进行反馈
Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'跟从账户
if Status="Tradeing" and filled>0 and Account=CoVer_textbox2.text then
\'正向跟踪
IF FX =0 THEN
if aspect=0 then
if kaiping=0 then order.Buy 1,ss,0,0,code,market,CoVer_textbox3.text,0
if kaiping>0 then order.sellshort 1,ss,0,0,code,market,CoVer_textbox3.text,0
\'msgbox iCode & " " & iMarket
end if
if aspect=1 then
if kaiping=0 then order.Buyshort 1,ss,0,0,code,market,CoVer_textbox3.text,0
if kaiping>0 then order.sell 1,ss,0,0,code,market,CoVer_textbox3.text,0
end if
end if
\'反向跟踪
IF FX=1 THEN
if aspect=1 then
if kaiping=0 then order.Buy 1,ss,0,0,code,market,CoVer_textbox3.text,0
if kaiping>0 then order.sellshort 1,ss,0,0,code,market,CoVer_textbox3.text,0
end if
if aspect=0 then
if kaiping=0 then order.Buyshort 1,ss,0,0,code,market,CoVer_textbox3.text,0
if kaiping>0 then order.sell 1,ss,0,0,code,market,CoVer_textbox3.text,0
end if
end if
END IF
\'未成交单查询,不断做提示,大家也可以+点代码 让他发出声音或者发群消息/邮件/短信,不断骚扰你
IF Remaining<>0 then
call application.SetTimer(1,1000)
end if
End Sub
sub application_timer(id)
dim Orderid \'订单ID
dim Filled \'提交手数
dim Remaining \'剩余手数
dim Action \'买卖
dim OrderType \'订单类型
dim LmtPrice \'委托价
dim Account \'账户
dim Kaiping \'开平
dim i
i=0
if id = 1 then
if order.OrderNum2<>0 then
For i=0 to order.OrderNum2-1
Call Order.OrderInfo2(i,OrderID,ConSign,Filled,Remaining,Action,OrderType,LmtPrice,Account,Kaiping,Code,Market)
call application.MsgOut("有未成交单 市场代码: "&Market&" "&" "&"品种代码: " & Code)
Next
end if
if order.OrderNum2 = 0 then
application.KillTimer(id)
end if
end if
end sub
sub application_vbaend()
application.KillTimer(id)
end sub