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

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內(nèi)容

金字塔等價(jià)K線源碼 [金字塔]

  • 金字塔等價(jià)K線源碼內(nèi)容:


    dim shanchushanchu = 0     '是否刪除歷史數(shù)據(jù),1為需要
    dim dangtianshuju '當(dāng)日是否有數(shù)據(jù),0為沒有dangtianshuju = 1
    dim bili bili = 0.001    '等價(jià)線區(qū)間
    dim xinheyuexinheyue = "IF88"  '新等價(jià)K合約代碼dim xinmingchengxinmingcheng = "IF等價(jià)K線" '新等價(jià)K合約名稱dim xinshichangxinshichang = "ZJ" '新等價(jià)K合約市場
    dim laoheyuelaoheyue = "IF00" '標(biāo)的合約代碼dim laoshichanglaoshichang = "ZJ" '標(biāo)的合約市場dim laozhishulaozhishu = "IF13"
    Sub lishishuju()
        '查詢品種是否存在,不存在則新建    cunzai = marketdata.IsExistStock(xinheyue,xinshichang)    if cunzai = 0 then       call marketdata.AddStock(xinheyue,xinshichang, xinmingcheng)        application.MsgOut "等價(jià)K線【創(chuàng)建成功】!"    else       application.MsgOut "等價(jià)K線【已經(jīng)存在】!"    end if
            '等價(jià)區(qū)間處理     set Report1 = marketdata.GetReportData(laoheyue,laoshichang)        qj = Report1.Open*bili         '刪除歷史數(shù)據(jù),創(chuàng)建第一根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 "等價(jià)K線【歷史數(shù)據(jù)初始化】成功!"    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        '新建一個(gè)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()‘第一次用的時(shí)候請先運(yùn)行改宏創(chuàng)建等價(jià)K線數(shù)據(jù)     call lishishuju()end sub
    Sub APPLICATION_VBAStart()    call Application.SetTimer(0,1000) '創(chuàng)建一個(gè)0號定時(shí)器,間隔時(shí)間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           '等價(jià)區(qū)間處理          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        '新建一個(gè)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()
    '得到上期所指定品種的日線數(shù)據(jù)Set History = marketdata.GetHistoryData("IF88","ZJ",0)'刪掉第一條數(shù)據(jù)for i=0 to History.Count-1History.Volume(i) = 0next
    call History.SaveData("IF88","ZJ",1)



    End Sub
     

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 1145508240  有需要幫忙請點(diǎn)擊這里留言!!!進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 久久9999国产精品免费 | 国产精品美女www爽爽爽视频 | 精品久久天干天天天按摩 | 亚洲在线小视频 | 在线观看色 | 精品中文字幕不卡在线视频 | 澳门一级特黄录像免费播黄 | 日日夜夜嗷嗷叫 | 国产精品视频免费在线观看 | 波多野结衣视频一区二区 | 成人国产精品一级毛片天堂 | 欧美在线性爱视频 | 亚洲日本在线观看视频 | 国产成人mv在线观看入口视频 | 精品国产自在现线看久久 | 成人欧美视频在线看免费 | 抱着cao才爽视频 | 久久精品国产精品青草图片 | 欧美成人h | 久久亚洲国产午夜精品理论片 | 国产精品永久免费10000 | 国产福利视频奶水在线 | 国产图区 | 永久黄网站色视频免费观看 | 成人日韩| 欧美日韩国产一区二区三区 | 91国高清视频 | 国产精品久久久久久福利 | 国产免费福利视频 | 欧美日韩一区二区三 | 99青青青精品视频在线 | 天天干视频在线 | 成人午夜影院在线观看 | 青草国产 | 亚洲人成网站在线观看青青 | 99在线精品国产不卡在线观看 | 91视频观看 | 久久最新精品 | 一级女性全黄生活片免费看 | 久久精品观看影院2828 | 91视频免费观看高清观看完整 |