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

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

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

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

 

ss:=1; //手?jǐn)?shù)
extgbdataset('t1_position',0);
//0表示沒(méi)有倉(cāng)位,1表示持有多頭, -1表示持有空頭
extgbdataset('t1_holding',0);
//0表示沒(méi)有倉(cāng)位,>0表示持有多頭, <0表示持有空頭
extgbdataset('t1_enterbarpos',0);//記錄其開(kāi)倉(cāng)的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ā)生過(guò)開(kāi)倉(cāng)信號(hào),則那一根k線不再交易
 if extgbdata('t1_enterbarpos') = barpos then begin
  goto continueline ;
 end
 
//沒(méi)有持倉(cāng)狀態(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.weiqiv.net.cn
         extgbdataset('t1_holding',-ss);
         extgbdataset('t1_enterbarpos',barpos);
         goto continueline ;
        
      end
end//沒(méi)有持倉(cāng)狀態(tài)
    
//持有倉(cāng)位狀態(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) ;

 

 

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

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

 


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

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
  主站蜘蛛池模板: 啪啪免费网站入口链接 | 天天射天天搞 | 毛片在线观看网站 | 国产免费播放一区二区 | 成人老司机深夜福利久久 | 欧美成人性做爰网站免费 | 国产日韩欧美在线一区二区三区 | 亚洲精品一区二区久久 | 久久99在线 | 91在线视频网址 | 久草在线视频中文 | 国产日产欧产美一二三区 | 久久亚洲综合中文字幕 | 免费久福利视频在线观看 | 欧美日韩久久中文字幕 | 国产一级淫片a视频免费观看 | 欧美成成人免费 | 九天玄帝诀高清300集免费观看 | 热久久视久久精品18国产 | 日韩一区二区三区在线观看 | 成人毛片免费观看视频大全 | 久久草在线视频国产一 | 久久亚洲国产的中文 | 国产伦精品一区二区三区网站 | 99热7| 久久久久久综合成人精品 | 国产精品日韩欧美 | 国产免费久久精品99 | 国产区综合另类亚洲欧美 | 亚洲国产精品久久婷婷 | 久草男人天堂 | 精品视频在线观看一区二区 | 一本到视频在线观看 | 成年网站视频在线观看 | 日本一级毛片视频网站 | 激情网婷婷| 日韩中文字幕在线亚洲一区 | 波多野结衣一区二区三区 | 伊人网99 | 国产福利在线 | 操操免费视频 |