您現(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來(lái)實(shí)現(xiàn),只是代碼量比后臺(tái)或圖表策略大的多,調(diào)試也需要較長(zhǎng)的時(shí)間。

    如果只是單純的實(shí)現(xiàn)開(kāi)平倉(cāng)的目的,沒(méi)有必要使用VBa來(lái)做的。

     

     

  • 網(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)文章

    沒(méi)有相關(guān)內(nèi)容
主站蜘蛛池模板: 亚洲欧美精品午睡沙发| a毛看片免费观看视频| 麻豆国产精品va在线观看不卡| 精品无码中出一区二区| 日本三级韩国三级美三级91| 大学生久久香蕉国产线看观看| 偷拍区小说区图片区另类呻吟 | 韩国一级在线观看| 日韩亚洲人成网站| 国产又黄又硬又湿又黄的| 久久亚洲精精品中文字幕| 高清无码一区二区在线观看吞精 | 天天射综合网站| 亚洲美女中文字幕| 99re热在线观看| 每日更新在线观看av| 国产高清视频一区三区| 亚洲欧美一区二区三区在线| 69视频在线是免费观看| 欧美日本高清在线不卡区| 国产精品成人久久久久久久| 亚洲人成亚洲人成在线观看| 精品一区二区视频在线观看| 最近中文字幕免费mv视频| 国产性夜夜夜春夜夜爽| 久久亚洲中文字幕精品一区| 男男chinese同志gay露脸飞机| 天堂а√在线地址| 亚洲AV日韩AV永久无码下载| 麻豆国产原创剧情精品| 希崎杰西卡一二三区中文字幕| 人妻无码aⅴ不卡中文字幕| 97国产在线公开免费观看| 欧美日韩亚洲视频| 国产精品久久免费视频| 久草视频福利资源站| 青娱乐国产视频| 成人字幕网视频在线观看| 免费观看性行为视频的网站| 99久久精品这里只有精品| 欧美中日韩在线|