请教各位大侠,搜索论坛里面 “ 如何枚举市场中的所有合约 ” ,有大侠提到用如下代码可以提取当前所有品种。
小弟把它导到VBA 里面运行,但是有几个问题请教
1、查询出来的SRX01 和SRY1301 ,但是它的开盘和其他行情系统里面的SR1301 、SR1401 无法对应,请问如何查询SR1301 和SR1401 数据呢?
2、翻遍了 reportdata 的说明,找不到 当日收盘价和持仓量的信息,请问如何查询呢?
http://www.weistock.com/bbs/dispbbs.asp?BoardID=5&replyID=61328&ID=1176&skin=1
Sub Test()
Dim MaxCode
Dim MaxVolume
'得到市场所有品种
Count = MarketData.GetReportCount("ZQ")
For i = 0 To Count-1
Set Report1 = MarketData.GetReportDataByIndex("ZQ",i)
'只处理SR合约
if Left(Report1.Label,2) = "SR" Then
'只处理有效合约
if Right(Report1.Label,2) >= "01" And Right(Report1.Label,2) <= "12" Then
If Report1.Volume > MaxVolume Then
MaxCode = Report1.Label
MaxVolume = Report1.Volume
End if
end if
End if
Next
'显示成交量最大得合约
MsgBox MaxCode
End Sub