[原创]导出合约和数据 [金字塔]
- 咨询内容:
sub exportsymbols()
market=array("sq","dq","zq","zj","sy")
mymarkets=array("shfe","dce","czce","cffex","shfe")
dim contractvolume
dim contractopenint
dim contractlabel
dim contractmarket
set fso = createobject("scripting.filesystemobject")
set file = fso.createtextfile("d:\\weistocksymbols.csv",true)
set block=createobject("stock.block")
for i=0 to ubound(market)
for j=0 to marketdata.getreportcount(market(i))-1
set myreport=marketdata.getreportdatabyindex(market(i),j)
suffixlabel=right(myreport.label,2)
prefixlabel=left(myreport.label,len(myreport.label)-2)
if (suffixlabel="00" or suffixlabel="01" or suffixlabel="02" or suffixlabel="03" or suffixlabel="04" or suffixlabel="05" or suffixlabel="06" or suffixlabel="07" or suffixlabel="08" or suffixlabel="09" or suffixlabel="10" or suffixlabel="11" or suffixlabel="12" or suffixlabel="13") and lcase(prefixlabel)<>"gn" then
file.writeline market(i)&"_"&myreport.label
end if
next
next
file.close()
print("导出金字塔合约")
end sub
- 金字塔客服: sub exportdata() markets=array("sq","dq","zq","zj","sy") set block=createobject("stock.block") set fso = createobject("scripting.filesystemobject") futureday=base&"\\futureday\\" futuremin=base&"\\futuremin\\" futuretick=base&"\\futuretick\\" createpath fso,futureday createpath fso,futuremin createpath fso,futuretick for i=0 to ubound(markets) for j=0 to marketdata.getreportcount(markets(i))-1 set myreport=marketdata.getreportdatabyindex(markets(i),j) code=myreport.label market=myreport.marketname set myhistory = marketdata.gethistorydata(code,market,0) if myhistory.count>0 then set file = fso.createtextfile(futuremin&code&"_min.csv",true) for n=0 to myhistory.count - 1 file.writeline myhistory.date(n)&","&myhistory.open(n)&","&myhistory.high(n)&","&myhistory.low(n)&","&myhistory.close(n)&","&myhistory.volume(n)&","&myhistory.openint(n) next file.close end if set myhistory = marketdata.gethistorydata(code,market,5) if myhistory.count>0 then set file = fso.createtextfile(futureday&code&"_day.csv",true) for n=0 to myhistory.count - 1 file.writeline myhistory.date(n)&","&myhistory.open(n)&","&myhistory.high(n)&","&myhistory.low(n)&","&myhistory.close(n)&","&myhistory.volume(n)&","&myhistory.openint(n) next file.close end if set minutedata = marketdata.getminutedata(code,market) if minutedata.count>0 then mydate=convertdate(minutedata.date(n)) set file = fso.createtextfile(futuretick&code&"_tick_"&mydate&".csv",true) for n=0 to minutedata.count - 1 file.writeline minutedata.date(n)&","&minutedata.newprice(n)&","&minutedata.bidprice(n)&","&minutedata.askprice(n)&","&minutedata.volume(n)&","&minutedata.bidvol(n)&","&minutedata.askvol(n)&","&minutedata.openint(n) next file.close end if next next print("导出数据")end sub
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容