Sub gethold(iLabel,imarket,buyhold,sellhold)
'取指定品种合约的今持信息
dim BuyHoding
dim BuyTodayHoding
dim SellHoding
dim SellTodayHoding
dim BuyCost
dim SellCost
dim PNL
Dim UseMargin
buyhold=0
sellhold=0
'取指定持仓品种信息
application.msgout time & " gethold参数,iLabel:" & iLabel &" imarket:" & imarket
Result = Order.HoldingInfoByCode2(iLabel,imarket,BuyHoding,BuyCost,BuyTodayHoding,SellHoding,SellCost,SellTodayHoding,PNL,UseMargin,"")
If Result <> 1 Then
application.msgout time & "gethold程序取持仓失败"
Exit Sub
else
buyhold=BuyTodayHoding
sellhold=SellTodayHoding
End If
End Sub
一直输出取持仓失败.何故?输入参数是对的
9:14:23 gethold参数,iLabel:C05 imarket:DQ
9:14:23gethold程序取持仓失败
[此贴子已经被作者于2014/12/3 9:14:18编辑过]
行了,应该吧最后的""删除
[此贴子已经被作者于2014/12/3 14:31:17编辑过]
还是不对!怎么搞的呀???
Sub gethold(iLabel,imarket,buyhold,sellhold)
'取指定品种合约的今持信息
dim BuyHoding
dim BuyTodayHoding
dim SellHoding
dim SellTodayHoding
dim BuyCost
dim SellCost
dim PNL
Dim UseMargin
buyhold=0
sellhold=0
'取指定持仓品种信息
application.msgout time & " iLabel:" & iLabel &" imarket:" & imarket
Result = Order.HoldingInfoByCode2(iLabel,imarket,BuyHoding,BuyCost,BuyTodayHoding,SellHoding,SellCost,SellTodayHoding,PNL,UseMargin,"811050")
If Result <> 1 Then
application.msgout time & "gethold程序取持仓失败"
Exit Sub
else
buyhold=BuyTodayHoding
sellhold=SellTodayHoding
End If
End Sub
9:08:13 iLabel:C05 imarket:DQ
9:08:13gethold程序取持仓失败
9:08:14 iLabel:C05 imarket:DQ
9:08:14gethold程序取持仓失败
9:08:19 iLabel:C05 imarket:DQ
9:08:19gethold程序取持仓失败