private HistoryData1, HistoryData2,diff
Sub TLStart()
\'"""注册品种"""
call marketdata.RegReportNotify("NI09","SQ")
call marketdata.RegReportNotify("AL06","SQ")
End Sub
\'\'###########################################################################
Sub MARKETDATA_ReportNotify(ReportData)
\'"""处理行情推送"""
Set Report_NI = marketdata.GetReportData("NI09","SQ")
Set Report_AL = marketdata.GetReportData("AL06","SQ")
if ReportData.Label="NI09" then
marketdata.HistoryDataMode = 1 \'不同品种为独立的缓冲区
set HistoryData1 = marketdata.GetHistoryData("NI09","SQ",0,50)
set HistoryData2 = marketdata.GetHistoryData("AL06","SQ",0,50)
diff = HistoryData1.close(HistoryData1.Count-2) - HistoryData2.Close(HistoryData2.Count-2)
application.MsgOut Report_NI.date&" "&HistoryData1.Close(HistoryData1.Count-2)&" "&Report_AL.date&" "&HistoryData2.Close(HistoryData2.Count-2)&" "&diff
end if
end sub