Rss & SiteMap

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

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

标题:[求助] 如何枚举市场中的所有合约的当日收盘价和当日收盘持仓呢?

1楼
jazzson 发表于:2012/8/10 11:43:21

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

小弟把它导到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

2楼
guotx2010 发表于:2012/8/10 11:54:01
用GetHistoryData方法获取收盘价。
共2 条记录, 每页显示 10 条, 页签: [1]


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