以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  金字塔软件问题提交  (http://222.73.7.161/bbs/list.asp?boardid=2)
----  报 价窗格不刷新  (http://222.73.7.161/bbs/dispbbs.asp?boardid=2&id=147578)

--  作者:deni977
--  发布时间:2017/2/9 10:22:39
--  报 价窗格不刷新
请教:

图表MAIN 调出自定义的等价K线,右侧的“报”窗格,就算有新行情来也不刷新,如何设置?


--  作者:wenarm
--  发布时间:2017/2/9 10:28:10
--  
截图看下你的设置。
--  作者:deni977
--  发布时间:2017/2/9 10:44:30
--  
如图


--  作者:shq
--  发布时间:2017/2/9 10:47:45
--  
图未上传成功。贴图教程  http://www.weistock.com/bbs/dispbbs.asp?BoardID=2&ID=31614&skin=0


图片点击可在新窗口打开查看此主题相关图片如下:论坛贴图第三步.jpg
图片点击可在新窗口打开查看


--  作者:deni977
--  发布时间:2017/2/9 10:52:19
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20170209105145.jpg
图片点击可在新窗口打开查看

--  作者:shq
--  发布时间:2017/2/9 10:57:31
--  
自定义的等价K线您是怎么创建的?成交的数据取自哪里?
--  作者:deni977
--  发布时间:2017/2/9 11:03:35
--  
订阅了行情,行情数据到来的时候,产生的自定义等价K线


Sub MarketData_ReportNotify(ReportData)
            
            NewPrice=ReportData.NewPrice
            stkLable=ReportData.Label          
           
            \'Application.Msgout Cdate(time) & ",Code:" & stkLable & "  ,NewPrice:" & NewPrice
            
            if (StrComp(stkLable,"PB00")=0) then 
            
\'             Application.Msgout Cdate(time) & ",Code:" & stkLable & "  ,NewPrice:" & NewPrice
                    set Report1 = marketdata.GetReportData(laoheyue,laoshichang)
\'                           close2 = report1.newprice     
\' Application.Msgout Cdate(time) & ",Code:" & stkLable & "  ,close2:" & close2
Set NewHistory2 = marketdata.GetHistoryData(xinheyue,xinshichang,0)      \'1f
        call application.PeekAndPump        
        if NewHistory2.Count>2 then
        CompareH=NewHistory2.open(NewHistory2.Count-1)
        end if
        mxopen2 = NewHistory2.open(NewHistory2.Count-1)
        mxclose2 = NewHistory2.close(NewHistory2.Count-1)
        mxhigh2 = NewHistory2.high(NewHistory2.Count-1)
        mxlow2 = NewHistory2.low(NewHistory2.Count-1)
        mxDate2 = NewHistory2.Date(NewHistory2.Count-1)                
        close2 = report1.newprice
        mxDate2 = Report1.Date    
        if close2 > mxhigh2 then mxhigh2 = close2 end if
        if close2 < mxlow2  then mxlow2 = close2 end if        
       
        NewHistory2.close(NewHistory2.Count-1) = close2
        NewHistory2.high(NewHistory2.Count-1) = mxhigh2
        NewHistory2.low(NewHistory2.Count-1) = mxlow2
        NewHistory2.Date(NewHistory2.Count-1) = mxdate2  
       

       
        call NewHistory2.SaveData(xinheyue,xinshichang,1) \'保存
       
        qj = 20
       
        if abs(close2-mxopen2) > qj then \'判断是否达到区间
        \'新建一根K线
        call NewHistory2.InsertAt(0)
        NewHistory2.open(NewHistory2.Count-1) = close2
        NewHistory2.close(NewHistory2.Count-1) = close2
        NewHistory2.high(NewHistory2.Count-1) = close2
        NewHistory2.low(NewHistory2.Count-1) = close2
        NewHistory2.Date(NewHistory2.Count-1) = mxdate2
       
        call NewHistory2.SaveData(xinheyue,xinshichang,1) \'保存
       
        Application.Msgout " 新建K线成功。"&  Cdate(time) & ",Code:" & stkLable & "  ,NewPrice:" & NewPrice    
        end if  
        call Technic.Refresh       
       
            end if

End Sub


--  作者:shq
--  发布时间:2017/2/9 11:12:44
--  
VBA相关问题请前往高级功能研发区 http://www.weistock.com/bbs/index.asp?boardid=5 发帖求助。