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

四周規(guī)則能寫成VBA模板嗎,方便大家學(xué)習(xí) [金字塔]

  • 咨詢內(nèi)容:

    四周規(guī)則能寫成VBA模板嗎,方便大家學(xué)習(xí)

    HHN:=ref(HHV(HIGH,20),1);
    HLN:=ref(LLV(LOW,20),1);

    IF H>=HHN then
    begin
    sellshort(holding<0,0,thisclose);
    buy(holding=0,1,thisclose);
    end

    IF L<=HLN then
    begin
    sell(holding>0,0,thisclose);
    buyshort(holding=0,1,thisclose);
    end

     

  • 金字塔客服:

    有必要嗎

    圖表可以實(shí)現(xiàn) VBA還要寫一遍。

     

  • 用戶回復(fù):

    任何策略都可以用VBA來實(shí)現(xiàn),只是代碼量比后臺(tái)或圖表策略大的多,調(diào)試也需要較長(zhǎng)的時(shí)間。

    如果只是單純的實(shí)現(xiàn)開平倉的目的,沒有必要使用VBa來做的。

     

     

  • 網(wǎng)友回復(fù): Sub ForWeekRule
     dim code
     dim market
     dim cyctype
     dim highest
     dim lowest
     
     code="RU00"
     market="SQ"
     cyctype=5
     
     set historydata =marketdata.GetHistoryData(code,market,cyctype)
     for i=historydata.count-22 to historydata-2
      if historydata.high(i)>highest then
       highest=historydata.high(i)
      end if
      
      if historydata.low(i)<lowest then
       lowest=historydata.low(i)
      end if
     next
     
     if historydata(historydata.count-1)>highest then
      order.buyshort 1,1,0,0,code,market,0,0
      order.buy 1,1,0,0,code,market,0,0
     end if
     
     if historydata(historydata.count-2)<lowest then
      order.SellShort 1,1,0,0,code,market,0,0
      order.sell 1,1,0,0,code,market,0,0
     end if
    end sub

     

  • 網(wǎng)友回復(fù):

    強(qiáng)Sub ForWeekRule
     dim code
     dim market
     dim cyctype
     dim highest
     dim lowest
     
     code="RU00"
     market="SQ"
     cyctype=5
     
     set historydata =marketdata.GetHistoryData(code,market,cyctype)
     for i=historydata.count-22 to historydata-2
      if historydata.high(i)>highest then
       highest=historydata.high(i)
      end if
      
      if historydata.low(i)<lowest then
       lowest=historydata.low(i)
      end if
     next
     
     if historydata(historydata.count-1)>highest then
      order.buyshort 1,1,0,0,code,market,0,0
      order.buy 1,1,0,0,code,market,0,0
     end if
     
     if historydata(historydata.count-2)<lowest then
      order.SellShort 1,1,0,0,code,market,0,0
      order.sell 1,1,0,0,code,market,0,0
     end if
    end sub


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 自慰被室友看见强行嗯啊男男| 免费看激情按摩肉体视频| jizz国产在线观看| 暖暖直播在线观看| 亚洲综合无码无在线观看| 色综合久久天天综合| 国产精品亚洲成在人线| ssss国产在线观看| 日日夜夜天天久久| 亚洲中文字幕无码日韩| 狼色精品人妻在线视频| 国产swag剧情在线观看| 免费在线你懂的| 日本一区二区三区在线观看视频| 亚洲欧美日韩精品久久亚洲区| 亚洲伦理中文字幕| 奇米第四色首页| 久久久www成人免费精品| 欧美伊久线香蕉线新在线| 免费a级毛片18以上观看精品| 边吃奶边插下面| 国产精品一区高清在线观看| av天堂午夜精品一区二区三区| 日本www高清视频| 亚洲www视频| 波多野结衣与老人系列| 午夜aaaaaaaaa视频在线| 风间由美性色一区二区三区| 国产精品免费看久久久无码| ass美女下部精品图片| 成人无码精品1区2区3区免费看 | 夜色www国产精品资源站| 中文字幕无码不卡免费视频| 日韩高清在线高清免费| 亚洲日韩久久综合中文字幕| 麻豆91免费视频| 国产精品无码av在线播放| 99精品在线视频观看| 少妇人妻偷人精品视频| 中日韩欧美视频| 日本黄色激情片|