[Visual Basic] 复制代码
Sub ORDER_OrderStatusEx2(OrderID, Status, Filled, Remaining, Price, Code, Market, OrderType, Aspect, Kaiping, Account, AccountType)
Result = Order.HoldingInfoByCode2(Code,Market,BuyHolding,BuyCost,BuyTodayHolding,SellHolding,SellCost,SellTodayHolding,PNL,UseMargin,Account)
if Status="Submitted" and Account="AAA" then
if aspect=0 then
if kaiping=0 then order.Buy 0,int((Filled+Remaining)*1/2),Price,0,code,market,"BBB",0
if kaiping>0 then order.sellshort 0,min(SellHolding,int((Filled+Remaining)*1/2)),Price,0,code,market,"BBB",0
end if
if aspect=1 then
if kaiping=0 then order.Buyshort 0,int((Filled+Remaining)*1/2),Price,0,code,market,"BBB",0
if kaiping>0 then order.sell 0,min(BuyHolding,int((Filled+Remaining)*1/2)),Price,0,code,market,"BBB",0
end if
end if
end sub