Sub SavetoExcelKtime = 3 ''3分钟K线''使用前请注意将K线主图打开,''得到框架名称为"Technic",窗格名称为"Main"的窗格对象Set Grid = Technic.GetGridByName"Main"Set History = Grid.GetHistoryData CountStart = InputBox"起始序号:", 1CountLength = InputBox"长度:",1 ''创建EXCEL对象Set objExcel = CreateObject"Excel.Application"objExcel.Visible = TrueobjExcel.Workbooks.Addfor i = 0 to CountLength-1j = CountStart + i -1 if j < History.Count thenobjExcel.Cellsi+1,1.Value = History.DatejobjExcel.Cellsi+1,2.Value = History.OpenjobjExcel.Cellsi+1,3.Value = History.ClosejobjExcel.Cellsi+1,4.Value = History.HighjobjExcel.Cellsi+1,5.Value = History.Lowjend ifnextMsgBox"OK"End Sub这是我用的,保存k线数据,不过速度很慢不要指望金字塔会让你很爽。
龚家风2019-12-21 21:20:47