示例
‘该示例从郑州市场筛选SR合约得最大持仓量做为主力合约
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
===============
所有的SZ市场的品种市场代码都是SZ的,如果你要区分创业板,你可以直接通过股票代码来却分。如果你不知道怎么区分,你可以看一下 工具菜单-》市场与板块-》打开深圳市场,里面金字塔已经帮你区分好了