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 bufAllmsgBox Data1.Countfor 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.Closemarketdata.DestroyHistoryDatamsgBox bufAllmsgBox "ok"End Sub - 金字塔客服: 本地数据是否齐全,非专业版只能获取1000根数据
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容