您现在的位置:程序化交易>> 期货公式>> 金字塔等>> 其他期货软件知识>>正文内容

[原创]筛选主力合约的宏 [金字塔]

  • 咨询内容:

    以下内容为程序代码:

    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编辑过]

     

  • 金字塔客服: 以下内容为程序代码:

    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

     

  • 用户回复:

    谢谢!分享!

     

  • 网友回复:

    这个该怎么用?

     

    还真不会,指点指点?

     

  • 网友回复: 具体如何建立一个宏呢?能用一个视频具体说明一下吗?或者有什么具体的教程没有?

 

如果以上指标公式不适用于您常用的行情软件

或者您想改编成选股公式,以便快速选出某种形态个股的话,

可以联系我们相关技术人员 QQ: 262069696  点击在线交流进行 有偿 改编!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容