我想把手上的仓都平掉,为什么下面这段代码做不了了?以前老版本还可以的!
PendingCount = Order.Holding2
For i = 0 to PendingCount - 1
Call Order.HoldingInfo2(i, BuyHoding, BuyCost, BuyTodayHoding, SellHoding, SellCost, SellTodayHoding,PNL,UseMargin,Code,Market,Account)
call Application.MsgOut(Code)
call Application.MsgOut(i+1)
call Application.MsgOut(BuyHoding)
call Application.MsgOut(BuyTodayHoding)
call Application.MsgOut(SellHoding)
call Application.MsgOut(SellTodayHoding)
if BuyHoding > 0 then
Call Order.Sell(1,BuyHoding,Price,0,Code,Market,"",0)
call Application.MsgOut("Duo")
end if
if SellHoding > 0 then
Call Order.Sellshort(1,SellHoding,Price,0,Code,Market,"",0)
call Application.MsgOut("Kong")
end if
Next
这说明应该有持仓,为什么BuyHoding和SellHoding拿不到值?