'sssssssssssssssssssssssssssssssssssssss行情来临事件
Sub MarketData_ReportNotify(ReportData)
NewPrice=ReportData.NewPrice
stkLable=ReportData.Label
'Application.Msgout Cdate(time) & ",Code:" & stkLable & " ,NewPrice:" & NewPrice
if (StrComp(stkLable,"PB00")=0) then
set Report1 = marketdata.GetReportData(laoheyue,laoshichang)
Set NewHistory2 = marketdata.GetHistoryData(xinheyue,xinshichang,0) '1f
call application.PeekAndPump
if NewHistory2.Count>2 then
CompareH=NewHistory2.open(NewHistory2.Count-1)
end if
mxopen2 = NewHistory2.open(NewHistory2.Count-1)
mxclose2 = NewHistory2.close(NewHistory2.Count-1)
mxhigh2 = NewHistory2.high(NewHistory2.Count-1)
mxlow2 = NewHistory2.low(NewHistory2.Count-1)
mxDate2 = NewHistory2.Date(NewHistory2.Count-1)
close2 = report1.newprice
mxDate2 = Report1.Date
if close2 > mxhigh2 then mxhigh2 = close2 end if
if close2 < mxlow2 then mxlow2 = close2 end if
NewHistory2.close(NewHistory2.Count-1) = close2
NewHistory2.high(NewHistory2.Count-1) = mxhigh2
NewHistory2.low(NewHistory2.Count-1) = mxlow2
NewHistory2.Date(NewHistory2.Count-1) = mxdate2
call NewHistory2.SaveData(xinheyue,xinshichang,1)
'存入1f k线
qj = 20
if abs(close2-mxopen2) > qj then
'大于等价区间
'新建一个K线
call NewHistory2.InsertAt(NewHistory2.Count)
NewHistory2.open(NewHistory2.Count-1) = close2
NewHistory2.close(NewHistory2.Count-1) = close2
NewHistory2.high(NewHistory2.Count-1) = close2
NewHistory2.low(NewHistory2.Count-1) = close2
NewHistory2.Date(NewHistory2.Count-1) = mxdate2
call NewHistory2.SaveData(xinheyue,xinshichang,1)
'存入1f k线
Application.Msgout “新建K线成功。” & Cdate(time) & ",Code:" & stkLable & " ,NewPrice:" & NewPrice
end if
call Technic.Refresh '刷新图表
end if
End Sub