Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]筛选主力合约的宏

1楼
z7c9 发表于:2011/1/22 19:41:49

以下内容为程序代码:

1 sub getmydominantcontract()
2     dim marketname
3     dim sblock
4     dim contractvol    
5
6     marketname = array("SQ","DQ","ZQ","ZJ")
7     set sblock = createobject("stock.block")
8     
9     for i=0 to ubound(marketname)
10         n=marketdata.GetReportCount(marketname(i))
11         for j=0 to n-1
12             set myreport = marketdata.GetReportDataByIndex(marketname(i),j)
13             suffixlabel = right(myreport.label,2)            
14             if suffixlabel>="01" and suffixlabel<="12" then
15                 if myreport.volume>contractvol then
16                     contractvol=myreport.volume
17                     contractlabel=myreport.label
18                 end if
19             end if            
20             if suffixlabel = "20" then
21                 sblock.addstock marketname(i),contractlabel
22                 contractvol=0
23                 c自选","自设股"    
28 end sub
29

[此贴子已经被作者于2011-1-22 19:47:43编辑过]
2楼
z7c9 发表于:2011/1/23 14:59:42
以下内容为程序代码:

1 sub getdominantcontract()
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     c"
16     contractvolume=0
17     
18     for i=0 to ubound(market)
19         n=marketdata.GetReportCount(market(i))
20         for j=0 to n-1
21             set report1=marketdata.GetReportDataByIndex(market(i),j)
22             suffixlabel=right(report1.label,2)
23             
24             if suffixlabel="00" then
25                 block.addstock contractmarket,contractlabel
26                 c"
28                 contractvolume=0
29             end if
30             
31             if suffixlabel>="01" and suffixlabel<="12" then
32                 if report1.volume>contractvolume then
33                     contractlabel=report1.label
34                     contractmarket=market(i)
35                     contractvolume=report1.volume
36                 end if
37             end if
38         next
39     next
40     
41     block.addstock contractmarket,contractlabel
42     block.tosave "自选","自设股"
43     msgbox "完成筛选主力合约"
44 end sub
3楼
淡定688 发表于:2011/2/28 22:28:39

谢谢!分享!

4楼
fisher 发表于:2012/5/12 13:34:43

这个该怎么用?

 

还真不会,指点指点?

5楼
MEIYU 发表于:2012/5/18 8:13:24
具体如何建立一个宏呢?能用一个视频具体说明一下吗?或者有什么具体的教程没有?
6楼
admin 发表于:2012/5/18 9:15:07
 

时间:2010-04-22

金字塔VBA编程教程

http://v.youku.com/v_show/id_XMTY3MjE1NjY0.html

共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03516 s, 2 queries.