Rss & SiteMap

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

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

标题:现在只能搜索到上期夜市的主力品种。

1楼
qq代人发帖 发表于:2014/6/23 9:53:27

请教:我是用程序交易,需要自动搜索板块的品种,以前各个交易所的都能搜到,现在只能找到上期夜市的品种了。

就是用金字塔哦论坛上的SearchCode代码搜索主力品种,现在只能搜索到上期夜市的主力品种了
2楼
yukizzc 发表于:2014/6/23 9:58:51
是pel语言的吗?相关代码最好发下。
3楼
torymiss 发表于:2014/6/23 22:32:50
Sub SearchStart()
 
  application.MsgOut Date &" " &Time& "检索主力合约"
 Dim marketName
 Set dominantContract=CreateObject("Scripting.Dictionary") '创建一个字典
 marketName=Array("SQ","DQ","ZQ","ZJ","SY")
 prefixStockNameOld=""
 c"
 contractVol=0
 
 '找到的主力合约代码放这里
 
  
 For j=0 To UBound(marketName)
  n=marketData.GetReportCount(marketName(j))
  For i=0 To n-1
   Set reportData=marketdata.GetReportDataByIndex(marketName(j),i)
   prefixStockNameCur=left(reportData.StockName,2)
   suffixStockNameCur=right(reportData.StockName,2)
   If suffixStockNameCur>="00" And suffixStockNameCur<"99" And reportData.Volume>0 Then
    If prefixStockNameCur<>prefixStockNameOld Then
     If contractLabel<>"" Then
      dominantContract.Add contractMarket & contractLabel, 0
     End If
     prefixStockNameOld=prefixStockNameCur
     contractLabel=reportData.Label
     contractMarket=marketName(j)
     contractVol=reportData.Volume
    ElseIf reportData.Volume>contractVol then
     contractLabel=reportData.Label
     contractVol=reportData.Volume
    End If
              
   End If
  Next  
 Next
 dominantContract.Add contractMarket & contractLabel,0
 
 
 labels=dominantContract.Keys
 markets=dominantContract.Keys
 
 FndCount = UBound(dominantContract.Keys)
 Application.MsgOut "共找到"&FndCount&"个合约"
 
 If FndCount > 0 Then
  '整理一下数据,将市场和代码分开
  For j=0 To FndCount
      Application.MsgOut "分析"&labels(j)
   markets(j) = left(labels(j),2)
   labels(j) = right(labels(j),len(labels(j))-2)
  Next 
  SaveBlockAndOpen labels, markets
 Else
  MsgBox "没有找到主力合约"
 End if
 
End Sub
4楼
torymiss 发表于:2014/6/23 22:33:16

楼上就是代码

5楼
王锋 发表于:2014/6/24 23:47:04

你那个代码由于受到论坛安全限制无法显示全,去下载这个完整的吧

http://www.weistock.com/bbs/dispbbs.asp?BoardID=5&ID=2670&replyID=&skin=1

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


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