以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  VBA如何获取更多的历史数据和历史指标数据  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=149946)

--  作者:kooex
--  发布时间:2017/3/31 9:24:54
--  VBA如何获取更多的历史数据和历史指标数据
如下代码只能获取20条数据,请问如何获取更多的数据?

Sub UserForm1_CommandButton1_Click()
Set Data1= marketdata.GetHistoryData("if06","zj",2)
Set FormulaSAR = marketdata.StkindiByData("SAR",Data1)
Set FormulaMACD = marketdata.StkindiByData("MACD",Data1)

Dim bufAll
msgBox Data1.Count
for i=1 to Data1.Count
Dim bufOne
bufOne = CStr(Data1.Date(Data1.Count-i))+","+CStr(Data1.Open(Data1.Count-i))+","+CStr(Data1.High(Data1.Count-i))+","+CStr(Data1.Low(Data1.Count-i))+","+CStr(Data1.Close(Data1.Count-i))+","+CStr(Data1.Volume(Data1.Count-i))+","+CStr(FormulaSAR.GetBufData("SARV",Data1.Count-i))+","+CStr(FormulaMACD.GetBufData("DEA",Data1.Count-i))+chr(10)
bufAll = bufAll + bufOne
\'msgbox Formula.GetBufData("SARV",Data1.Count-i)
next

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("D:\\\\data.txt",True)
a.Write(bufAll)
a.Close
marketdata.DestroyHistoryData
msgBox bufAll
msgBox "ok"
End Sub

--  作者:yukizzc
--  发布时间:2017/3/31 10:06:41
--  
本地数据是否齐全,非专业版只能获取1000根数据