十六、CTP账户的跟单VBA代码
B账户跟着A账户做单(前提是知道A账户的密码,在同一个金字塔同时登陆A账户和B账户)
Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
if Status="Tradeing" and filled>0 and Account="8000000000" then
if aspect=0 then
if kaiping=0 then order.Buy 1,filled,0,0,code,market,"800000",0
if kaiping>0 then order.sellshort 1,filled,0,0,code,market,"800000",0
end if
if aspect=1 then
if kaiping=0 then order.Buyshort 1,filled,0,0,code,market,"800000",0
if kaiping>0 then order.sell 1,filled,0,0,code,market,"800000",0
end if
end if
End Sub
==============
B帐户累计成交5手A帐户才开仓如何实现?
我现在要求A帐户在股指这个品种上累计买入开仓5手股指~(等于持仓5手多单的那一刻)
B帐户才在股指上买入开仓1手...
如何实现?
如果金字塔的VBA有很好的真实持仓函数就好了~
后台那个tbuyholdingex非常容易出错啊...
比如~挂单没成交的时候~系统是没法通过后台的函数判断你持仓的那5手还在不在...
不然我用后台就实现了...
现在请教一下VBA如何实现我说的这个功能?
参考 VBA 的
HoldingInfo2 方法
另外还要对应指定品种~
火哥能写个例子就好了