vba數(shù)學(xué)函數(shù) [金字塔]
- 咨詢(xún)內(nèi)容:
請(qǐng)問(wèn)用vba編程計(jì)算兩個(gè)商品相關(guān)性要怎么做?在vba編程信息里沒(méi)有找到相關(guān)函數(shù)是不是要自己定義還是可以調(diào)用金字塔函數(shù)?
- 金字塔客服:
Array 對(duì)象
Alike 計(jì)算該數(shù)組與其他Array對(duì)象之間的相似系數(shù),例如Alike(ar)表示求與ar數(shù)組對(duì)象之間的相似度
Releate 計(jì)算該數(shù)組與其他Array對(duì)象之間的相關(guān)系數(shù)
- 用戶(hù)回復(fù):
Sub TLStart1()
call marketdata.RegReportNotify("P05","DQ")
call marketdata.RegReportNotify("Y05","DQ")End Sub
Sub MARKETDATA_ReportNotify(ReportData) Set Report1 = marketdata.GetReportData("P05","DQ") Set Report2 = marketdata.GetReportData("Y05","DQ") Set histroydata1 = MarketData.GetHistoryData("P05","DQ",0) Set histroydata2 = MarketData.GetHistoryData("Y05","DQ",0)
Dim data Set data = CreateObject("Stock.Array") For i =0 to 149 data.AddBack(histroydata1.Close(histroydata1.count-i)) next if data.count>150 then ata.removeat(0) end if
Dim data1 Set data1 = CreateObject("Stock.Array") For i =0 to 149 data1.AddBack(histroydata2.Close(histroydata2.count-i)) next if data1.count>150 then data1.removeat(0) end if
'相關(guān)性計(jì)算corr = data.releate(data1) application.MsgOut Cdate(time)& ",相關(guān)性:" & corr
Set d1 = nothing '釋放對(duì)象Set d2 = nothing
End Sub 請(qǐng)問(wèn)為什么輸出的相關(guān)性數(shù)值都是1呢?是不是這么計(jì)算是錯(cuò)誤的 - 網(wǎng)友回復(fù):
MarketData 對(duì)象
HistoryDataMode 歷史數(shù)據(jù)處理處理模式 0默認(rèn)值,GetHistoryData,GetHistoryDataByDate 方法取到的對(duì)象為共享模式;1為獨(dú)立模式,打開(kāi)不同品種可以分別處理各自的數(shù)據(jù),數(shù)據(jù)處理完畢后要調(diào)用DestroyHistoryData方法銷(xiāo)毀內(nèi)存緩沖區(qū).
- 網(wǎng)友回復(fù): 明白了,還有一個(gè)問(wèn)題,就是數(shù)組元素如何監(jiān)控?用application.msgout data(0)輸出顯示對(duì)象不支持
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容