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

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

四周規則能寫成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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 久久精品国产亚洲麻豆小说 | 天海翼一区二区三区免费 | 俄罗斯一级成人毛片 | 免费播放欧美毛片欧美a | 日日摸天天摸狠狠摸视频 | 亚洲一级理论片 | 91aaa在线观看 | 国产欧美久久久精品影院 | 日本无吗中文字幕免费婷婷 | 国产资源站 | 亚洲tv精品一区二区三区 | 男人免费网站 | 国产日韩欧美中文字幕 | 久艹在线观看视频 | 欧美精品成人一区二区视频一 | 久久精品国产曰本波多野结衣 | 天天狠狠色综合图片区 | 91国内精品久久久久怡红院 | 久久视频这里只有精品 | 免费骚视频| 中文字幕在线高清 | 亚洲欧美在线综合一区二区三区 | 欧美专区综合 | 中文字幕在线观看免费视频 | 国产色婷婷精品免费视频 | 欧美亚洲国产精品 | 国产亚洲精品福利在线 | 国产伦精品一区二区三区 | 日本三级做a全过程在线观看 | 天天干天天插 | 国产精品伦理一区二区三区 | 四虎b7s22c0m| 国产69精品久久久久777 | 国产二区精品 | 久久久久久国产精品免费免费 | 国产日韩欧美综合一区 | 国产a免费视频 | 日本不卡免费高清视频 | 日韩美一区二区三区 | 中文字幕一区二区三区在线播放 | 婷婷在线视频观看 |