- bikbok
-
这个将博易大量导成文本文件。
博易大师数据转飞狐交易师 VBS
Sub Main() "脚本主程序,请在此下写入主程序代码
dateNum=10 "0代表全部导入,初始化的时候,全部导入,以后建议只更新最近几天的数据, 10代表只导出最近10天
strFile="E:证券数据poboData yefutDayCONC.day" "博易大师日线文件(美国原油连续)
fileName="C:TXTDAYIDIDCONC.TXT" "导出的文件(飞狐交易师标准文本文件)
PoboToFoxtraderTXT strFile,fileName,dateNum
End Sub "脚本主程序结束
Sub PoboToFoxtraderTXT(strFile,fileName,dateNum)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim objStream, fso, jiaGe(10)
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile strFile
If dateNum=0 Then
dateNum= objStream.Size/32
ElseIf dateNum < objStream.Size/32 Then
dateNum=dateNum
Else
dateNum=objStream.Size/32
End If
objStream.position = objStream.Size-dateNum*32
For i = 1 To dateNum
readFile = AscB(objStream.Read(1))+AscB(objStream.Read(1))*256+AscB(objStream.Read(1))*256*256+AscB(objStream.Read(1))*256*256*256
nian = readFile1048576
yue = readFile65536-nian*16+100
ri = (readFile Mod 65536)2568+100
riQi = CStr(nian)+"/"+Right(CStr(yue),2)+"/"+Right(CStr(ri),2)
For j = 1 To 4
readFile = AscB(objStream.Read(1))+AscB(objStream.Read(1))*256+AscB(objStream.Read(1))*256*256+AscB(objStream.Read(1))*256*256*256
jiaGe(j) =CStr(readFile/1000)+" "
Next
objStream.position = objStream.position+12 "成交量和持仓量数据结构未知,暂时不导出!
shuChu = shuChu+riQi+" "+jiaGe(2)+jiaGe(3)+jiaGe(4)+jiaGe(1)+vbCrLf
riQi=""
Next
objStream.Close
Set objStream = Nothing
Set fso=CreateObject("Scripting.FileSystemObject")
If fso.FolderExists("C:TXTDAY") Then
i=0
Else
fso.CreateFolder ("C:TXTDAY")
End If
Set MyFile=fso.OpenTextFile(fileName,ForWriting,True,TristateFalse)
MyFile.WriteLine shuChu
MyFile.close
Set MyFile = Nothing
Set fso = Nothing
End Sub
- FinCloud
-
建议使用文华财经来进行此操作,那样非常容易。
- nicejikv
-
你好,这个股票软件我下载了下来试了一下,事实证明,确实不能导出
- u投在线
-
教你在熊市中也能赚钱74.86.194.115/?fromuid=106494
- 好投
-
好像不行