以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  [原创]筛选连续合约的方法  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=4949)

--  作者:z7c9
--  发布时间:2011/1/22 19:07:48
--  [原创]筛选连续合约的方法

以下内容为程序代码:

1 sub getcontinuouscontract()
2     dim marketname
3     set b=createobject("stock.block")
4     
5     marketname=Array("SQ","DQ","ZQ","ZJ")    
6     
7     for i=0 to ubound(marketname)
8         n=marketdata.GetReportCount(marketname(i))
9         for j=0 to n-1
10             set myreport = marketdata.GetReportDataByIndex(marketname(i),j)
11             suffixlabel=right(myreport.label,2)
12             if suffixlabel="00" then
13                 b.addstock marketname(i),myreport.label
14             end if    
15         next
16     next
17     
18     b.tosave "自选","自选股"
19 end sub

[此贴子已经被作者于2011-1-22 19:08:35编辑过]

--  作者:z7c9
--  发布时间:2011/1/23 15:00:06
--  
以下内容为程序代码:

1 sub getcontinuouscontract()
2     dim block
3     dim market
4     
5     set block=createobject("stock.block")
6     
7     block.open "自选股",1
8     
9     for i=0 to block.count-1
10         block.removeat(0)
11     next    
12     
13     market=array("SQ","DQ","ZQ","ZJ")
14     
15     for i=0 to ubound(market)
16         n=marketdata.GetReportCount(market(i))
17         for j=0 to n-1
18             set report1=marketdata.GetReportDataByIndex(market(i),j)
19             if right(report1.label,2)="00" then
20                 block.addstock market(i),report1.label
21             end if
22         next
23     next
24     
25     block.tosave "自选","自选股"
26     msgbox "完成筛选连续合约"
27 end sub

--  作者:tj1abcd
--  发布时间:2011/5/2 23:30:43
--  
复制粘贴 无法通过
--  作者:王锋
--  发布时间:2011/5/3 9:05:13
--  
去掉行号