for pzindex=0 To 5 step 1
for zhouqi = 0 to 5 step 1
if zhouqi<2 or zhouqi>4 then
set History = marketdata.GetHistoryData(code(pzindex),market(pzindex),zhouqi)
Xa=today
set mkt = marketdata.GetMarketInfo2(market(pzindex))
if zhouqi<2 then Xa=cdate(today+mkt.opentime-cdate("1975-1-1")+cdate("00:0" & zhouqimin(zhouqi) & ":00"))
a=History.GetPosFromDate(Xa)
aaa=History.GetPosFromDate(cdate(today+mkt.closetime-cdate("1975-1-1")))
copentime=cdate(mkt.opentime-cdate("1975-1-1"))
if zhouqi<2 then Kn = mkt.TradeSeconds / 60 / zhouqimin(zhouqi)
if zhouqi=5 then
if cdate(time)>cdate(copentime) and History.Date(aaa)<>cdate(today) then strcon=strcon & code(pzindex) & " 当天日线缺失" & vbCrLf
else
if History.Date(a)<cdate(today) then aa=aaa-a else aa=aaa-a+1
mins = DateDiff("n",cdate(copentime),cdate(time))
if mins>-1 and (cdate(time)<cdate("11:30:00") or cdate(time)>cdate("13:00:00")) then'中午休市时不检查
if cdate(time)<cdate("11:30:00") then
mins = mins \ zhouqimin(zhouqi)+1
elseif cdate(time)>cdate("13:00:00") then
mins = mins \ zhouqimin(zhouqi)+1-90 \ zhouqimin(zhouqi)
end if
if mins<>aa and aa<Kn then
strcon=strcon & code(pzindex) & " 当天" & zhouqimin(zhouqi) & "分钟K线数目前为" & aa & ",应为" & mins & vbCrLf
elseif aa>Kn then
strcon=strcon & code(pzindex) & " 当天" & zhouqimin(zhouqi) & "分钟K线数目前为" & aa & ",应为" & Kn & vbCrLf
end if
end if
end if
end if
next
next