以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  高级功能研发区  (http://weistock.com/bbs/list.asp?boardid=5)
----  [求助] 如何枚举市场中的所有合约的当日收盘价和当日收盘持仓呢?  (http://weistock.com/bbs/dispbbs.asp?boardid=5&id=13588)

--  作者:jazzson
--  发布时间:2012/8/10 11:43:21
--  CLOSETIME函数在股指期货交割日会返回150000,还是仍旧151500?

请教各位大侠,搜索论坛里面 “ 如何枚举市场中的所有合约 ” ,有大侠提到用如下代码可以提取当前所有品种。

小弟把它导到VBA 里面运行,但是有几个问题请教

1、查询出来的SRX01 和SRY1301 ,但是它的开盘和其他行情系统里面的SR1301 、SR1401 无法对应,请问如何查询SR1301 和SR1401 数据呢?

2、翻遍了 reportdata 的说明,找不到 当日收盘价和持仓量的信息,请问如何查询呢?

 

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

 

 Sub Test()
 
 Dim MaxCode
 Dim MaxVolume
 
 \'得到市场所有品种
 Count = MarketData.GetReportCount("ZQ")
 
 For i = 0 To Count-1
  Set Report1 = MarketData.GetReportDataByIndex("ZQ",i)
  \'只处理SR合约
  if Left(Report1.Label,2) = "SR" Then
   \'只处理有效合约
   if Right(Report1.Label,2) >= "01" And Right(Report1.Label,2) <= "12" Then
    If Report1.Volume > MaxVolume Then
     MaxCode = Report1.Label
     MaxVolume = Report1.Volume
    End if
   end if
  End if
 Next
 
 \'显示成交量最大得合约
 MsgBox MaxCode
 
End Sub


--  作者:guotx2010
--  发布时间:2012/8/10 11:54:01
--  
用GetHistoryData方法获取收盘价。