Sub getcizhuli()
pz = "cu "'定义品种
pzzms = 2
sc = "sq" '定义市场
maxOpenint = 0
midOpenint = 0
minOpenint = 0
lxhy = pz&"00"
Set History = marketdata.GetHistoryData(lxhy,sc,5)
    Count = History.Count-1
    for i=0 to Count
    mxdate = History.Date(i)
    Openint = History.Openint(i)
    
    n = marketdata.GetReportCount(sc) 
    For j = 0 To n - 1 
        Set report1 = marketdata.GetReportDataByIndex(sc, j) 
            If left(report1.Label,2) = pz  Then 
               Set History1 = marketdata.GetHistoryData(report1.Label,sc,5)
                    Count1 = History1.Count-1          
                    for m=0 to Count1
                    date1 = History1.Date(m)
                        if date1=mxdate then
                           Openint1 = History1.Openint(m)
                           
                              if Openint1 > maxOpenint then
                              maxOpenint = Openint1
                              elseif  Openint1 > midOpenint then
                              midOpenint = Openint1
                              else 
                              minOpenint = Openint1
                              end if 
                           
                 
                        end if 
                    next
              'application.MsgOut mxdate&" "&report1.Label
            End If 
           
    Next 
    
    application.MsgOut mxdate&" "&midOpenint
    next
End Sub
以上红色部分数据输出有问题,请指教