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

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

[原創]輪詢交易,信號反復,導致多次開平。我參考了個程序,看看能否行? [金字塔]

  • 咨詢內容:

    WARNING_DISABLE:4;
    ss:=1; //手數
    extgbdataset('t1_position',0);
    //0表示沒有倉位,1表示持有多頭, -1表示持有空頭
    extgbdataset('t1_holding',0);
    //0表示沒有倉位,>0表示持有多頭, <0表示持有空頭
    extgbdataset('t1_enterbarpos',0);//記錄其開倉的K線

    maa:ema(c,10);
    bpk:=cross(c,maa);
    spk:=cross(maa ,c);
    //非最后一根K線退出
    if not(islastbar) or workmode<>1 then exit;

    //如果當是最后一根k線,執行
    IF islastbar and  time<151000 then begin

     // 如果最后一根k線發生過開倉信號,則那一根k線不再交易
     if extgbdata('t1_enterbarpos') = barpos then begin
      goto continueline ;
     end
     
    //沒有持倉狀態
    if extgbdata('t1_position')=0  and extgbdata('t1_holding')=0 then begin
         if  bpk then begin
          
            buy(1,ss,c);
            extgbdataset('t1_position',1);
            extgbdataset('t1_holding',ss);
            extgbdataset('t1_enterbarpos',barpos);
            goto continueline ;
          
          end

          if spk then begin
         
             buyshort(1,ss,c);
             extgbdataset('t1_position',-1);//程序化交易 www.weiqiv.net.cn
             extgbdataset('t1_holding',-ss);
             extgbdataset('t1_enterbarpos',barpos);
             goto continueline ;
           
          end
    end//沒有持倉狀態
       
    //持有倉位狀態
       //持有空頭
    if bpk and extgbdata('t1_position')=-1   and  extgbdata('t1_holding')<0 then begin

           sellshort(1,ss,c);
           buy(1,ss,c);
           extgbdataset('t1_position',1);
           extgbdataset('t1_holding',ss);
           extgbdataset('t1_enterbarpos',barpos);
           goto continueline ;
         
    end
        //持有多頭
    if spk and extgbdata('t1_position')=1    and  extgbdata('t1_holding')>0  then begin

            sell(1,ss,c);
            buyshort(1,ss,c);
            extgbdataset('t1_position',-1);
            extgbdataset('t1_holding',-ss);
            extgbdataset('t1_enterbarpos',barpos);
            goto continueline ;
          
    end
    END//if  ISLASTBAR

    if  time>=151300 then begin

                 sell(extgbdata('t1_holding')>0,ss,c);
                 sellshort(extgbdata('t1_holding')<0,ss,c);
                 extgbdataset('t1_position',0);
                 extgbdataset('t1_holding',0);
                        
    end

    continueline@ 資產:tasset,linethick0;
    position:=extgbdata('t1_position');
    t1holding:=extgbdata('t1_holding');
    debugfile('d:\debug\803555.txt','position=%.0f' ,position) ;
    debugfile('d:\debug\803555.txt','t1holding=%.0f' ,t1holding) ;

     

     

    以上代碼能在金子塔里測試嗎?我用了,不能出信號。

     

  • 金字塔客服: 要學會自己測試+調試

 

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

可聯系技術人員 QQ: 1145508240  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 国产高清久久 | 欧美啪啪小视频 | 亚洲综合免费视频 | 国产高清不卡一区二区三区 | 狠狠一区 | 狠狠狠地啪香蕉 | 日本乱人伦片中文字幕三区 | 欧美永久免费 | 五月婷综合网 | 精品一区 二区三区免费毛片 | 免费国产a | 免费在线黄色网址 | 国产成人免费视频 | 亚洲国产成人精品一区91 | 天天拍夜夜添久久精品免费 | 久久在线看 | 免费观看呢日本天堂视频 | 国产精品久久久久毛片 | 亚洲五月花 | 天天插日日射 | 四虎久久影院 | 色偷偷要色偷偷网站视频在线 | 九九九九九九精品免费 | 久久欧美精品欧美久久欧美 | 国产精品高清视亚洲乱码 | 亚洲在线视频观看 | 国产成年网站v片在线观看 国产成人 免费观看 | 日本中文字幕有码 | 欧美亚洲国产精品久久久久 | 999精品在线 | 国产精品一国产精品 | 中文字幕第一页国产 | 日日夜夜网站 | 免费观看a毛片一区二区不卡 | 国产欧美日韩精品a在线观看高清 | 草操影院| 毛片一区 | 亚洲激情在线看 | 中文字幕天天躁夜夜狠狠综合 | 91麻豆精品一二三区在线 | 亚洲天堂一区 |