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

四周規則能寫成VBA模板嗎,方便大家學習 [金字塔]

  • 咨詢內容:

    四周規則能寫成VBA模板嗎,方便大家學習

    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

     

  • 金字塔客服:

    有必要嗎

    圖表可以實現 VBA還要寫一遍。

     

  • 用戶回復:

    任何策略都可以用VBA來實現,只是代碼量比后臺或圖表策略大的多,調試也需要較長的時間。

    如果只是單純的實現開平倉的目的,沒有必要使用VBa來做的。

     

     

  • 網友回復: 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

     

  • 網友回復:

    強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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 欧美欧洲性色老头老妇| 鲁一鲁中文字幕久久| 扒开两腿中间缝流白浆在线看| 交换年轻夫妇无删减| 黄床大片30分钟免费看| 奇米777在线视频| 久久精品香蕉视频| 熟妇人妻videos| 国产三级免费电影| .天堂网www在线资源| 少妇性俱乐部纵欲狂欢少妇| 久青草久青草视频在线观看| 狠狠做深爱婷婷综合一区| 国产乱子伦视频在线观看| 521色香蕉网站在线观看| 成人动漫在线观看免费| 亚洲AV无码乱码国产精品| 99久久免费国产精精品| 日产码一卡二卡三国产乱码| 亚洲午夜久久久影院伊人| 电台女诗岚第1到4部分| 国产一区二区三区乱码在线观看| 你懂的中文字幕| 天天干天天射天天爽| 中文字幕第12页| 最好的中文字幕2018免费视频| 亚洲精品成人av在线| 精品国产福利在线观看一区| 国产偷窥熟女精品视频| 波多野结衣99| 在线视频www| 一本色道久久综合一区| 日本特黄高清免费大片爽| 亚洲免费一级视频| 波多野结衣教室| 八戒八戒www观看在线| 菠萝蜜视频在线观看| 国产手机在线播放| 717影院理伦午夜论八戒| 天天看天天摸天天操| 中国孕妇变态孕交XXXX|