大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內容

金字塔等價K線源碼 [金字塔]

  • 金字塔等價K線源碼內容:


    dim shanchushanchu = 0     '是否刪除歷史數據,1為需要
    dim dangtianshuju '當日是否有數據,0為沒有dangtianshuju = 1
    dim bili bili = 0.001    '等價線區間
    dim xinheyuexinheyue = "IF88"  '新等價K合約代碼dim xinmingchengxinmingcheng = "IF等價K線" '新等價K合約名稱dim xinshichangxinshichang = "ZJ" '新等價K合約市場
    dim laoheyuelaoheyue = "IF00" '標的合約代碼dim laoshichanglaoshichang = "ZJ" '標的合約市場dim laozhishulaozhishu = "IF13"
    Sub lishishuju()
        '查詢品種是否存在,不存在則新建    cunzai = marketdata.IsExistStock(xinheyue,xinshichang)    if cunzai = 0 then       call marketdata.AddStock(xinheyue,xinshichang, xinmingcheng)        application.MsgOut "等價K線【創建成功】!"    else       application.MsgOut "等價K線【已經存在】!"    end if
            '等價區間處理     set Report1 = marketdata.GetReportData(laoheyue,laoshichang)        qj = Report1.Open*bili         '刪除歷史數據,創建第一根K線    if shanchu = 1 then            Set History1 = marketdata.GetHistoryData(xinheyue,xinshichang,0)            for j = 0 to History1.Count-1       History1.RemoveAt(j)       next           call History1.InsertAt(0)       History1.open(0) = Report1.Open       History1.close(0) = Report1.Open       History1.high(0) = Report1.Open       History1.low(0) = Report1.Open       History1.Date(0) = Report1.Date       History1.Volume(0) = Report1.Volume       History1.OpenInt(0) = Report1.OpenInt       call History1.SaveData(xinheyue,xinshichang,1)               application.MsgOut "等價K線【歷史數據初始化】成功!"    end if                  set minutedata = marketdata.GetMinuteData(laoheyue,laoshichang)    Count =  minutedata.Count            for i = 1 to count-1             Set History2 = marketdata.GetHistoryData(xinheyue,xinshichang,0)              mxopen = History2.open(History2.Count-1)        mxclose = History2.close(History2.Count-1)        mxhigh = History2.high(History2.Count-1)        mxlow = History2.low(History2.Count-1)        mxDate = History2.Date(History2.Count-1)        mxVolume = History2.Volume(History2.Count-1)        mxOpenInt = History2.OpenInt(History2.Count-1)        
            close = minutedata.newprice(i)        fbDate = minutedata.Date(i)              Volume = minutedata.Volume(i)        mxVolume = minutedata.Volume(i-1)        OpenInt = minutedata.OpenInt(i)        if close > mxhigh then mxhigh = close end if        if close < mxlow  then mxlow = close end if        mxdate = fbDate        mxxVolume = (Volume-mxVolume)+mxxVolume        mxOpenInt = OpenInt                History2.close(History2.Count-1) = close        History2.high(History2.Count-1) = mxhigh        History2.low(History2.Count-1) = mxlow        History2.Date(History2.Count-1) = mxdate          History2.Volume(History2.Count-1) = mxxVolume          History2.OpenInt(History2.Count-1) = mxOpenInt         call History2.SaveData(xinheyue,xinshichang,1)               if abs(close-mxopen) > qj then        '新建一個K線               call History2.InsertAt(History2.Count)        History2.open(History2.Count-1) = close        History2.close(History2.Count-1) = close        History2.high(History2.Count-1) = close        History2.low(History2.Count-1) = close        History2.Date(History2.Count-1) = mxdate          History2.Volume(History2.Count-1) = 0           History2.OpenInt(History2.Count-1) = OpenInt          call History2.SaveData(xinheyue,xinshichang,1)           mxxVolume = 0         end if             next
    End Sub
    sub dengjiaK()‘第一次用的時候請先運行改宏創建等價K線數據     call lishishuju()end sub
    Sub APPLICATION_VBAStart()    call Application.SetTimer(0,1000) '創建一個0號定時器,間隔時間1秒End Sub

    Sub APPLICATION_Timer(ID)       if ID = 0 then    
             if (cdate(time)<=cdate("11:30:00") and cdate(time)>cdate("9:15:00")) or (cdate(time)<=cdate("15:15:00") and cdate(time)>cdate("13:00:00")) then           '等價區間處理          set Report1 = marketdata.GetReportData(laoheyue,laoshichang)         qj = Report1.Open*bili               set Report2 = marketdata.GetReportData(laozhishu,laoshichang)                         Set History2 = marketdata.GetHistoryData(xinheyue,xinshichang,0)              mxopen = History2.open(History2.Count-1)        mxclose = History2.close(History2.Count-1)        mxhigh = History2.high(History2.Count-1)        mxlow = History2.low(History2.Count-1)        mxDate = History2.Date(History2.Count-1)        mxxVolume = History2.Volume(History2.Count-1)        mxOpenInt = History2.OpenInt(History2.Count-1)                set minutedata = marketdata.GetMinuteData(laoheyue,laoshichang)        Count =  minutedata.Count                         close = minutedata.newprice(Count-1)        fbDate = minutedata.Date(Count-1)         mxVolume = minutedata.Volume(Count-2)        Volume = minutedata.Volume(Count-1)        OpenInt = minutedata.OpenInt(Count-1)        if close > mxhigh then mxhigh = close end if        if close < mxlow  then mxlow = close end if        mxdate = fbDate        mxxVolume = mxxVolume+(Volume-mxVolume)        mxOpenInt =OpenInt'        application.MsgOut mxxVolume&" "&Volume&" "&Volume-mxVolume        
            History2.close(History2.Count-1) = close        History2.high(History2.Count-1) = mxhigh        History2.low(History2.Count-1) = mxlow        History2.Date(History2.Count-1) = mxdate          History2.Volume(History2.Count-1) = mxxVolume          History2.OpenInt(History2.Count-1) = mxOpenInt          call History2.SaveData(xinheyue,xinshichang,1)               if abs(close-mxopen) > qj then        '新建一個K線               call History2.InsertAt(History2.Count)        History2.open(History2.Count-1) = close        History2.close(History2.Count-1) = close        History2.high(History2.Count-1) = close        History2.low(History2.Count-1) = close        History2.Date(History2.Count-1) = mxdate          History2.Volume(History2.Count-1) = 0          History2.OpenInt(History2.Count-1) = OpenInt        call History2.SaveData(xinheyue,xinshichang,1)        mxxVolume = 0        end if             call Application.ActivateFrameWithCode("Technic",xinheyue,xinshichang,0)     call Technic.Refresh          end if                end if   end sub
    Sub to_0()
    '得到上期所指定品種的日線數據Set History = marketdata.GetHistoryData("IF88","ZJ",0)'刪掉第一條數據for i=0 to History.Count-1History.Volume(i) = 0next
    call History.SaveData("IF88","ZJ",1)



    End Sub
     

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 1145508240  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
主站蜘蛛池模板: 特级a欧美做爰片毛片 | 成人精品视频 成人影院 | 欧美成人综合在线 | 国产一二三区在线观看 | 日韩毛片最新看 | 老司机午夜精品视频播放 | 亚洲欧美日韩国产综合久 | 久久天天躁夜夜躁2019 | 欧美伊人久久 | 91综合精品网站久久 | 狠狠操夜夜操 | 91精品视频在线免费观看 | 国产萝控精品福利视频免费 | 人人澡人人干 | 中文字幕观看 | 伦伦影院精品一区 | 开心激情五月婷婷 | 精品亚洲成a人7777在线观看 | 精品美女在线 | 特级黄色毛片视频 | 亚洲高清一区二区三区久久 | 在线欧美激情 | 色老久久精品偷偷鲁一区 | 成人乱色短篇合集 | 能免费看黄的网站 | 欧美成人中文字幕dvd | 97av在线视频 | 欧美成年黄网站色视频 | 成人黄色一级毛片 | 亚洲欧美日韩成人网 | 泰国一级毛片aaa下面毛多 | 一级毛片不卡片免费观看 | 国产免费高清视频 | 国产色在线 | 亚洲 国产色在线视频 | 日本欧美在线播放 | 免费观看欧美一级高清 | 四虎影视永久免费观看网址 | 欧美精品a毛片免费观看 | 奇米狠狠干| 337p色噜噜人体大胆欧美 | 成人亚洲精品一区二区 |