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

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

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

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

 

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
       
        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//沒有持倉狀態
    
//持有倉位狀態
   //持有空頭
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) ;

 

 

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

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

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 全免费午夜一级毛片一级毛 | 看全色黄大色黄大片爽一下 | 九九51精品国产免费看 | 免费看爱爱视频 | 久久久久久久久久久96av | 99久9在线 | 免费 | 看黄a大片 免费 | 国产精品天天干 | 国产福利在线观看永久免费 | 国产综合在线观看 | 欧美日韩亚洲精品国产色 | 欧美亚洲国产精品第一页 | 日韩欧美国产偷亚洲清高 | 日韩高清欧美精品亚洲 | 精品免费国产一区二区三区 | 亚洲六月丁香色婷婷综合久久 | 亚洲涩综合| 精品免费久久久久久成人影院 | 在线欧美视频免费观看国产 | 中文字幕在线不卡精品视频99 | 久久精品国产99国产精品 | 97视频| 久久综合精品不卡一区二区 | 国产亚洲精品成人一区看片 | 99久久精品国产片 | 久久99精品久久久久久久不卡 | 日日爽夜夜 | 亚洲国产成人成上人色 | 久久er热在这里只有精品85 | 欧美激情久久欧美激情 | 国产成人精品日本亚洲语言 | 天天干人人 | 91久久香蕉国产线看 | 美女黄色免费在线观看 | 国产精品免费看久久久麻豆 | 日韩精品亚洲人成在线播放 | 久久中文字幕免费视频 | 偷亚洲偷国产欧美高清 | 久久久久久久久免费影院 | 99精品视频在线免费观看 | 久久久毛片免费全部播放 |