0表示持有多頭, <0表示持有空頭 extgbdataset('t1_…'name="Description" />

人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

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

金字塔 一根K線只出現(xiàn)一次同方向的平開 的源碼[金字塔模型]

 

ss:=1; //手數(shù)
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線,執(zhí)行
IF islastbar and  time<151000 then begin

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

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

       tsellshort(1,ss,mkt);
       tbuy(1,ss,mkt);
       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

        tsell(1,ss,mkt);
        tbuyshort(1,ss,mkt);
        extgbdataset('t1_position',-1);
        extgbdataset('t1_holding',-ss);
        extgbdataset('t1_enterbarpos',barpos);
        goto continueline ;
       
end
END//if  ISLASTBAR

if  time>=151300 then begin

             tsell(extgbdata('t1_holding')>0,ss,mkt);
             tsellshort(extgbdata('t1_holding')<0,ss,mkt);
             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) ;

 

 

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

可聯(lián)系技術人員 QQ: 262069696  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 视频一区中文字幕 | 日本r级在线观看播放 | 国产成人精品免费2021 | 国产精品1区 2区 3区 | 免费一级毛片在线播放不收费 | 日本草草| 久爱免费观看在线精品 | 午夜官网 | 亚洲国产成人久久精品影视 | 午夜免费网站 | 一级一片免费播放 | 欧美精品一二三区 | 最近免费中文字幕高清大全 | 国产成人免费片在线视频观看 | a毛片成人免费全部播放 | 精品亚洲成a人在线观看 | 好男人www社区资源在线观看 | 91精品国产综合成人 | x8x8国产精品视频 | 亚洲综合伊人色一区 | 亚洲欧洲日产国码 最新 | 人喾交性专区免费看 | 亚洲欧美日韩精品香蕉 | 在线色| 成年人视频在线 | 免费在线一级毛片 | 免费中文字幕在线观看 | 久久网色 | 久久精品成人免费看 | 毛片在线网站 | 亚洲永久视频 | 黄色大片在线看 | 国产成人在线影院 | 国产成人高清视频免费播放 | 香蕉视频网页版 | 人操人碰 | 在线免费激情视频 | 日韩免费看 | 亚洲最黄网站 | 国产三级图片 | 亚洲欧美日韩国产专区一区 |