金仕达跟CTP一样的,贴代码上来看看
dim BuyHolding
dim BuyCost
dim SellHolding
dim SellCost
Call Order.HoldingInfoByCode2(shili_report1.text,shili_report2.text,BuyHolding,BuyCost,BuyTodayHolding,SellHolding,SellCost,SellTodayHolding,PNL,UseMargin,sAccount)
iBuyHold=BuyHolding
iSellHold=SellHolding
BuyPrice=BuyCost
SellPrice=SellCost
call application.MsgOut(ibuyhold)
那看来是我又犯了什么错误了
我是输出该该持仓品种买入持仓总量 手工下了1手单 调试msgout出0
难道手工下单不顶用 要程序下单?应该不是这个问题吧
不管你什么方式下单的,有持仓就会返回的。
call application.MsgOut(ibuyhold)
call是多余的,后面的括号也不需要。正确的格式是
application.msgout iBuyHold
输出是能输出的 只不过输出的值不对 问题是我现在做了一个普通的窗体 想试试这个HoldingInfoByCode2,结果应该输出手数1 却一直输出0
Sub UserForm2_CommandButton1_Click()
dim BuyHolding
dim BuyCost
dim SellHolding
dim SellCost
Call Order.HoldingInfoByCode2("ag09","sq",BuyHolding,BuyCost,BuyTodayHolding,SellHolding,SellCost,SellTodayHolding,PNL,UseMargin,sAccount)
iBuyHold=BuyHolding
iSellHold=SellHolding
BuyPrice=BuyCost
SellPrice=SellCost
call application.MsgOut("成交单信息 "&ibuyhold&BuyHolding)
'if iBuyHold>0 then
End Sub