TestReport 回測(cè)怎么設(shè)置回測(cè)的起止時(shí)間? [金字塔]
- 咨詢內(nèi)容:
TestReport 回測(cè)怎么設(shè)置回測(cè)的起止時(shí)間?
- 金字塔客服:
用 GetHistoryDataByDate 取代范例中的 GetHistoryData 即可。
sub TEST()
set Data1= marketdata.GetHistoryDataByDate("if00","zj",0,"2014/8/8","2014/8/16") '讀中金所股指期貨主力合約指定時(shí)段的1分鐘數(shù)據(jù)
Application.MsgOut Data1.Count '打印輸出數(shù)據(jù)量
Application.MsgOut Data1.Date(0) '輸出第一個(gè)數(shù)據(jù)日期
Application.MsgOut Data1.Date(Data1.Count-1)'輸出最后一個(gè)數(shù)據(jù)日期
'數(shù)據(jù)處理完畢后,清理緩沖區(qū)
marketdata.DestroyHistoryData
End Sub - 用戶回復(fù):
Sub T5()
Testreport.StartAndInit '開(kāi)始測(cè)評(píng)系統(tǒng)的準(zhǔn)備工作
Testreport.InitCash=100*10000 '初始資金100萬(wàn)
set HistroyData= marketdata.GetHistoryDataByDate("au00","sq",5,"2014/1/2","2016/6/06") '讀主力合約指定時(shí)段的日線數(shù)據(jù)
Set Formula = marketdata.STKINDI("au00","sq","ma35()",0,5) '調(diào)用日線自定義指標(biāo)
Set HistroyData = Formula.ParentGrid.GetHistoryData '直接得到公式區(qū)的數(shù)據(jù)對(duì)象,提高運(yùn)行效率
msgbox HistroyData.date(0)
Application.msgout TestReport.ASSET
TestReport.StepIt i
Testreport.ShowReport
End Sub
但這里日期為什么是12月16?而不是2014/1/1
- 網(wǎng)友回復(fù):
工具-選項(xiàng)-維護(hù)
內(nèi)存保留,這邊的數(shù)量調(diào)大然后重啟電腦
- 網(wǎng)友回復(fù):
Sub T5()
Testreport.StartAndInit '開(kāi)始測(cè)評(píng)系統(tǒng)的準(zhǔn)備工作
Testreport.InitCash=100*10000 '初始資金100萬(wàn)
set HistroyData= marketdata.GetHistoryDataByDate("au00","sq",5,"2014/1/2","2016/6/06") '讀主力合約指定時(shí)段的日線數(shù)據(jù)
Set Formula = marketdata.StkindiByData("ma35()",HistroyData) '調(diào)用日線自定義指標(biāo)
msgbox HistroyData.date(0)
Application.msgout TestReport.ASSET
TestReport.StepIt i
Testreport.ShowReport
End Sub
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容