以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 高级功能研发区 (http://weistock.com/bbs/list.asp?boardid=5) ---- [原创]筛选连续合约与主力合约的自定义菜单 (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=4997) |
|
-- 作者:z7c9 -- 发布时间:2011/1/26 10:50:57 -- [原创]筛选连续合约与主力合约的自定义菜单
以下内容为程序代码:
1 Sub getcontinuouscontracts() 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 28 29 Sub getdominantcontracts() 30 Dim block 31 Dim market 32 33 Set block = CreateObject("stock.block") 34 35 block.Open "自设股", 1 36 37 For i = 0 To block.Count - 1 38 block.removeat (0) 39 Next 40 41 market = Array("SQ", "DQ", "ZQ", "ZJ") 42 c" 44 contractvolume = 0 45 46 For i = 0 To UBound(market) 47 n = marketdata.GetReportCount(market(i)) 48 For j = 0 To n - 1 49 Set report1 = marketdata.GetReportDataByIndex(market(i), j) 50 suffixlabel = Right(report1.Label, 2) 51 52 If suffixlabel = "00" Then 53 block.addstock contractmarket, contractlabel 54 c" 56 contractvolume = 0 57 End If 58 59 If suffixlabel >= "01" And suffixlabel <= "12" Then 60 If report1.volume > contractvolume Then 61 contractlabel = report1.Label 62 contractmarket = market(i) 63 contractvolume = report1.volume 64 End If 65 End If 66 Next 67 Next 68 69 block.addstock contractmarket, contractlabel 70 block.tosave "自选", "自设股" 71 MsgBox "成功筛选主力合约" 72 End Sub 73 74 Sub MENU_Show() 75 Menu.AddMenu 0, 0, "筛选连续合约" 76 Menu.AddMenu 1, 1, "筛选主力合约" 77 End Sub 78 79 Sub MENU_Command(Cmd) 80 Select Case Cmd 81 Case 0 82 getcontinuouscontracts 83 Case 1 84 getdominantcontracts 85 End Select 86 End Sub 87 |
|
-- 作者:wshj1214 -- 发布时间:2011/2/8 22:55:30 -- 谢谢,筛选连续合约和主力合约有什么好处,在软件中不是本身就已经有连续指数了吗,另外请教连续指数是取各主力合约的连续数据,还是像文华是取各合约的加权平均数的连续值,谢谢 |
|
-- 作者:z7c9 -- 发布时间:2011/2/9 8:52:13 -- 以下是引用wshj1214在2011-2-8 22:55:30的发言:
谢谢,筛选连续合约和主力合约有什么好处,在软件中不是本身就已经有连续指数了吗,另外请教连续指数是取各主力合约的连续数据,还是像文华是取各合约的加权平均数的连续值,谢谢 把连续合约和主力合约直接筛选到2个专门的版块,方便管理。 |
|
-- 作者:beensu -- 发布时间:2011/3/2 22:53:40 -- 请问版主 改成筛选每日增仓最大合约 如何改 |
|
-- 作者:kx2u -- 发布时间:2011/7/14 15:32:58 -- 请问这段代码要怎么弄到金字塔里? |
|
-- 作者:mwm283 -- 发布时间:2011/9/6 1:03:43 -- |