Rss & SiteMap

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

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

标题:[求助]请教这个持仓量问题,测试了,但没有数据

1楼
明心 发表于:2010/8/8 13:43:18

Function mxcc(Formula)
    mxcc=0
    Set Grid = Technic.GetGridByName("Main")
    Set Market = grid.GetMarketinfo()
    sc = market.id

    
    '得到该窗格所对应的动态行情对象
    Set ReportData = Grid.GetReportData()
    Label = ReportData.Label
    lab = Left(Label,2)

    
     '得到市场所有品种
 Count = MarketData.GetReportCount(sc)
 
 For i = 0 To Count-1
  Set Report1 = MarketData.GetReportDataByIndex(sc,i)

  if Left(Report1.Label,2) = lab Then

   if Right(Report1.Label,2) >= "01" And Right(Report1.Label,2) <= "12" Then
    If Report1.Volume >0 Then
     mxcc = mxcc+Report1.Volume
    End if
   end if
  End if
 Next
   
End Function

 

公式中调用这个函数,没有数据显示

[此贴子已经被作者于2010-8-8 13:52:14编辑过]
2楼
admin 发表于:2010/8/8 17:59:19

你需要显示什么

3楼
明心 发表于:2010/8/8 18:20:09

想算出对应品种所有合约的持仓量之和。

4楼
明心 发表于:2010/8/9 16:42:58

我的想法是这样的

1、通过获得目前合约的代码和该品种所在市场的代码

2、在该市场寻找符合条件的该品种所有合约

3、将这个品种的每个合约的持仓量相加

4、最后返回这个持仓量之和。

达到可以调用该品种的持仓量,共投资参考。

[此贴子已经被作者于2010-8-9 16:44:35编辑过]
5楼
董小球 发表于:2010/8/9 16:46:41
基本相当于套利合约了
共5 条记录, 每页显示 10 条, 页签: [1]


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