Rss & SiteMap

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

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

标题:关于等价K线

1楼
deni977 发表于:2017/2/9 11:20:27
用VBA自定义了等价K线,图表调用显示也正常,盘中通过订阅产生新的等价K线也正常,就是盘中图表调用的时候,右边“报”窗格,不刷新,请教如何设置?

盘中产生等价K线代码如下:

'sssssssssssssssssssssssssssssssssssssss行情来临事件
Sub MarketData_ReportNotify(ReportData)
            
            NewPrice=ReportData.NewPrice
            stkLable=ReportData.Label
           
           
            'Application.Msgout Cdate(time) & ",Code:" & stkLable & "  ,NewPrice:" & NewPrice
            
            if (StrComp(stkLable,"PB00")=0) then
                    set Report1 = marketdata.GetReportData(laoheyue,laoshichang)
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) '存入1f k线
       
        qj = 20
       
        if abs(close2-mxopen2) > qj then '大于等价区间
        '新建一个K线       
        call NewHistory2.InsertAt(NewHistory2.Count)
        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) '存入1f k线        
        Application.Msgout “新建K线成功。” & Cdate(time) & ",Code:" & stkLable & "  ,NewPrice:" & NewPrice    
        end if  
        call Technic.Refresh        '刷新图表
       
            end if

End Sub





2楼
deni977 发表于:2017/2/9 11:21:00
图表截图如下:

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

3楼
王锋 发表于:2017/2/9 11:33:21

没看到你可以让他刷新的任何代码。

参考 REPORT对象

4楼
deni977 发表于:2017/2/9 11:39:24
代码是MarketData_ReportNotify(ReportData) 事件中倒数第三句,call Technic.Refresh        '刷新图表,

这一句不能刷新图表的最新报价吗?


5楼
王锋 发表于:2017/2/9 12:15:05

set Report111 = marketdata.GetReportData("PB88",laoshichang)

 

得到你自建的品种report对象,然后设置该对象的数据,然后再刷新窗格

6楼
deni977 发表于:2017/2/9 21:59:27
非常感谢耐心回复、指导,最新价终于可以刷新了。
如下图,但是右侧的“报”价栏,还是没有刷新,是不是要象MAIN一样调用才可以?

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

7楼
马良 发表于:2017/2/10 7:56:49
报表的基本数据项要填全的。开高低收量额时间
8楼
deni977 发表于:2017/2/10 21:09:35
report 对象,很多是只读属性,无法完整写入啊
9楼
deni977 发表于:2017/2/10 22:28:29
一个一个填完,把只读的已经帅选出来了,非常感谢。
10楼
cq2698 发表于:2019/1/18 14:51:29
deni977 老师能不能发个完整的文件.请求加QQ40128320谢谢
共10 条记录, 每页显示 10 条, 页签: [1]


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