[Visual Basic] 复制代码 Sub GetcodeVolume()'获取大于指定成交量的品种列表
Dim TestCode
Dim TestVolume
TestVolume=10'日成交10手以上的品种才加入
'得到市场所有品种
Count = MarketData.GetReportCount("ZQ")
For i = 0 To Count-1
Set Report1 = MarketData.GetReportDataByIndex("ZQ",i)
if StrComp(Right(Report1.Label,2), "01")>=0 And StrComp(Right(Report1.Label,2), "12")<=-0 Then
If Report1.Volume >= TestVolume Then
TestCode = Report1.Label
Form1_ListBox1.additem TestCode & " " & Report1.Volume
End if
end if
Next
'显示成交量最大得合约
End Sub
Sub Form1_CommandButton1_Click()
GetcodeVolume
End Sub |