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

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

您現(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ā)生過開倉信號(hào),則那一根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);//程序化交易 m.weiqiv.net.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@ 資產(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à)格!

 


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
  主站蜘蛛池模板: 国产免费一区二区三区香蕉精 | 成人美女黄网站色大色费 | 久久精品资源站 | 99爱视频99爱在线观看免费 | 亚洲国产天堂在线网址 | 国产欧美成人xxx视频 | 国产亚洲精品成人一区看片 | 四虎黄色网址 | 久久精品在这里 | 久久99久久99精品 | 四虎影视在线永久免费观看 | 成人一级免费视频 | 日日摸夜夜爽 | 久草91| 日本b站一卡二不卡 | 成年超爽大片免费视频播放 | 欧美精品在线一区 | 亚洲高清中文字幕一区二区三区 | 国产资源福利 | 狠狠操综合 | 亚洲视频一 | 欧美大色网 | 一级一级毛片免费播放 | 欧美精品综合 | 91九色视频在线观看 | 亚洲视频免费在线播放 | 国产啪爱视频精品免视 | 久久综合给合久久狠狠狠97色 | 亚洲精品久久九九热 | 亚洲欧美日韩国产精品久久 | 欧美一区二区在线视频 | 天天曰天天 | 私人影院在线播放 | 91亚洲精品一区二区在线观看 | 五月四房婷婷 | 久久精品一区二区国产 | 天天碰夜夜 | 天天操天天摸天天射 | 夜夜欢视频 | 亚洲精品久久婷婷爱久久婷婷 | 欧美一级毛片特黄黄 |