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

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

請教開倉問題 [金字塔]

  • 咨詢內(nèi)容:

    RSI:=ref(SMA(MAX(CLOSE-REF(CLOSE,1),0),N1,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),N1,1)*100,1);
    UP:=ref(hhv(h,20),1);
    LD:=ref(llv(l,20),1);

    開多條件:=H>UP AND RSI<80;

    開空條件:=L<LD AND RSI>20;

     

    我的思路是價格突破20天高點時并且RSI值小于80開倉,如果大于80,則這個交易到下一個空單之前不開多單,但上面這種寫法是一旦RSI回到80一下,就會開多但,這個是我不想要的,請高手指點!

     

  • 金字塔客服:

    把原來的代碼都貼出來

     

  • 用戶回復:

    input:lots(1,0,9,1);
    input:n(4,0,9,1);
    input:n1(0.002,0.001,1,0.001);
    input:M(30,0,50,1);
    VARIABLE:maxprofit=0;
    win:=0;
    win2:=0;
    cc:=ref(c,1);
    cyc:=barslast(date>ref(date,1))+1;
    今高:=HHV(H,cyc);
    今低:=llv(l,cyc);
    BF:=ref(今高-今低,1);
    今開:=if(cyc=1,open,ref(open,cyc-1));
    昨收:="RXMA.ZC#DAY";
    昨高:="RXMA.ZH#DAY";
    昨低:="RXMA.ZL#DAY";
    10日平均波幅:="RXMA.MA10#DAY";
    RSI:=ref(SMA(MAX(CLOSE-REF(CLOSE,1),0),N1,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),N1,1)*100,1);
    UP:=ref(hhv(h,20),1);
    LD:=ref(llv(l,20),1);
    if time>=091600 and time<150500  then begin
     
      if holding=0 then begin
     
        if h>=up and RIS<80 then begin
          buy(holding=0,lots,limitr,max(open,up));
          maxprofit:=0;
      
        end
       
        if l<=ld AND RIS>20 then begin
          buyshort(holding=0,lots,limitr,min(open,ld));
          maxprofit:=0;
         
        end
      end
    end
     if holding>0 and enterbars>0 then begin
        win:=c-enterprice;
        if win>maxprofit then
         maxprofit:=win;
         win2:=(maxprofit-win)/maxprofit*100;
       end
         if holding>0 and enterbars>0 then begin
       多止損:sell(win<=-10,lots,LIMITR,c);
       多止盈:sell(maxprofit>20 and win2>=60 and openprofit>0,lots,limitr,c);
      end

      if holding<0 and enterbars>0 then begin
        win:=enterprice-c;
        if win>maxprofit then
        maxprofit:=win;
        win2:=(maxprofit-win)/maxprofit*100;
      end
      if holding<0 and enterbars>0 then begin
        空止損:sellshort(win<=-10,lots,limitr,c);;
        空止盈:sellshort(maxprofit>20 and win2>=60 and openprofit>0,lots,limitr,c);
       end  

         
    if holding<0 then begin
       if h>=up then begin
       sellshort(holding<0,0,limitr,max(open,up));
      end
       if time>=151400 then begin
        sellshort(1,lots,thisclose);
        
      end
     end
    if holding>0 then begin
      if l<=ld then begin
       sell(holding>0,0,limitr,min(open,ld));
      end
      if time>=151400 then begin
        sell(1,lots,thisclose);
       
      end
     end

    這是源碼,有其他不妥的地方也請高手指點!

     

  • 網(wǎng)友回復:

    input:lots(1,0,9,1);
    input:n(4,0,9,1);
    input:n1(0.002,0.001,1,0.001);
    input:M(30,0,50,1);
    VARIABLE:maxprofit=0;
    win:=0;
    win2:=0;

    RSI:=ref(SMA(MAX(CLOSE-REF(CLOSE,1),0),N1,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),N1,1)*100,1);
    UP:=ref(hhv(h,20),1);
    LD:=ref(llv(l,20),1);
    if time>=091600 and time<150500  then begin
     
      if holding=0 then begin
     
        if h>=up and Rsi<80 then begin
          buy(holding=0,lots,limitr,max(open,up));
          maxprofit:=0;
      
        end
       
        if l<=ld AND Rsi>20 then begin
          buyshort(holding=0,lots,limitr,min(open,ld));
          maxprofit:=0;
         
        end
      end
    end
     if holding>0 and enterbars>0 then begin
        win:=c-enterprice;
        if win>maxprofit then
         maxprofit:=win;
         win2:=(maxprofit-win)/maxprofit*100;
       end
         if holding>0 and enterbars>0 then begin
       多止損:sell(win<=-10,lots,LIMITR,c);
       多止盈:sell(maxprofit>20 and win2>=60 and openprofit>0,lots,limitr,c);
      end

      if holding<0 and enterbars>0 then begin
        win:=enterprice-c;
        if win>maxprofit then
        maxprofit:=win;
        win2:=(maxprofit-win)/maxprofit*100;
      end
      if holding<0 and enterbars>0 then begin
        空止損:sellshort(win<=-10,lots,limitr,c);;
        空止盈:sellshort(maxprofit>20 and win2>=60 and openprofit>0,lots,limitr,c);
       end  

         
    if holding<0 then begin
       if h>=up then begin
       sellshort(holding<0,0,limitr,max(open,up));
      end
       if time>=151400 then begin
        sellshort(1,lots,thisclose);
        
      end
     end
    if holding>0 then begin
      if l<=ld then begin
       sell(holding>0,0,limitr,min(open,ld));
      end
      if time>=151400 then begin
        sell(1,lots,thisclose);
       
      end
     end

     

  • 網(wǎng)友回復:

    給你在開平倉那里做個限定

     

    variable:n=0,m=0;

    if n=0 and 其他開多條件 then begin

    buy;

    n:=1;

    m:=0;

    end

     

    if m=0 and 其他開空條件 then begin

    buyshort;

    m:=1;

    n:=0;

    end

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯(lián)系技術人員 QQ: 511411198  點擊這里給我發(fā)消息進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內(nèi)容
主站蜘蛛池模板: 免费在线一级片 | 国产波多野结衣中文在线播放 | 欧美乱妇高清视频免欢看关 | 亚洲欧美日韩成人一区在线 | 六月婷婷中文字幕 | 欧美九九 | 亚洲国产成人久久综合区 | 久久久久久久国产精品毛片 | 久久视频精品线视频在线网站 | 久久久久久久国产高清 | 成人一级黄色毛片 | 色婷婷综合久久久久中文一区二区 | 国产亚洲精品美女久久久久 | 亚洲国产欧洲精品路线久久 | 中文字幕在线精品 | 有码中文字幕在线观看 | 五月婷婷激情综合网 | 久久午夜伦理 | 免费国产午夜在线观看 | 在线欧美精品一区二区三区 | 97在线观看视频免费 | 亚洲不卡一区二区三区在线 | 婷婷色中文字幕 | 国产在线观看a | 四虎影视1304t | 老司机午夜在线视频免费 | 一级毛片aa高清免费观看 | 久久99蜜桃精品久久久久小说 | 国产成人在线视频观看 | 国产免费美女视频 | 四虎影院在线看 | 亚洲成精品动漫久久精久 | 国产成人一区二区 | 99热久久这里只有精品在 | 四虎国产精品永久地址51 | 亚洲欧美中文字幕在线网站 | jizz免费在线观看 | 亚洲精品区 | 4hu四虎永久网址 | 377p欧洲最大胆艺术 | 性久久 |