Rss & SiteMap

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

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

标题:判断行情超过多长时间没有更新!

1楼
guotx2010 发表于:2013/7/10 11:43:57
使用股指最新行情的时间跟现在的时间比较,超过30秒就提醒。

Sub APP1
  Set Report1=MarketData.GetReportData("IF00","ZJ")
  StockTime=Report1.Date
  TimeSpace=DateDiff("s",Cdate(Now),StockTime)

  if abs(TimeSpace)>30 then
      Application.MsgOut "请注意,行情数据已经超过30秒没有更新了!"
      Exit Sub
  end if
End Sub



2楼
solarhe2006 发表于:2013/7/10 12:29:52
Sub APP1
  Set Report1=MarketData.GetReportData("IF00","ZJ")
  StockTime=Report1.Date
  TimeSpace=DateDiff("s",Cdate(Now),StockTime)

  if abs(TimeSpace)>30 then
      Application.MsgOut "请注意,行情数据已经超过30秒没有更新了!"
      Exit Sub
  end if
End Sub
3楼
guotx2010 发表于:2013/7/12 8:14:50
如果还用pel语言,可以是使用time和currenttime来比较,time是行情k线位置的时间,currenttime是计算机当前时间,这两个时间对比,可以达到类似的效果。

4楼
rushtaotao 发表于:2013/7/16 11:10:28
playsound函数
5楼
guotx2010 发表于:2013/7/16 13:50:29
是,使用application对象的playsound方法,播放一首歌,可以通过一个变量来控制是否已经在播放,如果在播放就不播,如果没有就开始播,然后设置变量的值,如果有行情了,就是用application对象的stopplay方法停止播放,并且设置变量的值。
6楼
guotx2010 发表于:2013/7/16 13:59:18
好人做到底,直接发现诚代码了。
private isPlay
Sub TEST()
    Set Report1=MarketData.GetReportData("IF00","ZJ")
     StockTime=Report1.Date
    TimeSpace=DateDiff("s",Cdate(Now),StockTime)
   if abs(TimeSpace)>30 then
      sSong=document.GetPrivateProfileString("Gen", "Alert","", "C:\ChanOrder.ini")
      if sSong<>"" and isPlay=0 then
           call application.PlaySoundFile(sSong)
           isPlay=1
           Application.MsgOut "请注意,行情数据已经超过30秒没有更新了!"
           Exit Sub
      end if
    else
          call application.StopPlay()
          isPlay=0
    end if 
End Sub
共6 条记录, 每页显示 10 条, 页签: [1]


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