Sub Test2()
'1.打開金字塔,依次打開"菜單-->工具-->選項-->常規",把"多分鐘線數"設置為5,確定
'2.重新打開金字塔軟件
'3.連續運行本程序兩次,觀察兩次輸出的時間的間隔,呵呵
dim hd,cycle,cycleMore,needDataCount
dim count,i
cycle=13 '多分鐘線
cycleMore=6 '定義多分鐘線:6分鐘
needDataCount=10'獲取10個數據
set hd=MarketData.GetHistoryData("IF08","ZJ",cycle,needDataCount,cycleMore)
count=hd.Count-1
for i=count to 0 step -1
Application.MsgOut "時間=" & hd.Date(i) & ",收盤價=" & hd.Close(i)
next
set hd=Nothing
Application.MsgOut "----------------------------"
End Sub
count=hd.Count-1
我是倒序用
你確定跑過代碼?
你確定跑過代碼?