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

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

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

 

ss:=1; //手?jǐn)?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;

//如果當(dāng)是最后一根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.tumamayizhan.com
         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@ 資產(chǎn):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) ;

 

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

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

 


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
  主站蜘蛛池模板: 日韩欧美亚洲乱码中文字幕| 老牛精品亚洲成av人片| 少妇大战黑吊在线观看| 亚洲AV无码一区二区二三区软件| 久久久久久久99精品国产片| 翘臀少妇被扒开屁股日出水爆乳| 国产精品毛片a∨一区二区三区| 中文字幕丰满孑伦| 樱桃黄高清完整版在线观看| 免费又黄又爽的视频| 青苹果乐园在线高清| 国产精品香蕉成人网在线观看| 一级片在线播放| 日韩欧美亚洲每的更新在线| 亚洲爆乳精品无码一区二区| 美女大量吞精在线观看456| 国产成人精品999在线| 97久久综合精品久久久综合| 成人怡红院视频在线观看| 久久精品无码一区二区日韩av| 欧美色欧美亚洲高清在线观看| 另类一区二区三区| 91精品国产欧美一区二区| 成人羞羞视频国产| 久久青青成人亚洲精品| 精品久久久久久无码中文字幕漫画| 国产成人午夜福利在线播放| 91精品观看91久久久久久| 少妇高潮流白浆在线观看| 久久久综合久久| 极品美女aⅴ高清在线观看| 亚洲精品成人网站在线观看| 综合558欧美成人永久网站| 国产在线视频资源| 制服丝袜自拍偷拍| 夜色福利久久久久久777777| 中文字幕在线观看一区| 日韩欧美亚洲中字幕在线播放 | 87福利电影网| 好男人在线社区www| 中文字幕日韩一区二区三区不|