欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 已经执行的信号因为后面信号闪烁后又消失了,怎么办?

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5231人关注过本帖平板打印复制链接

主题:已经执行的信号因为后面信号闪烁后又消失了,怎么办?

帅哥哟,离线,有人找我吗?
2017gogogoo
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:236 积分:0 威望:0 精华:0 注册:2017/7/20 10:49:07
  发帖心情 Post By:2017/9/29 11:12:30 [只看该作者]

这是公式代码,图表1分钟

 

input:ss(2,1,999,1),t(0,0,400000,1),p(0,0,400000,1);
VARIABLE:kzsATR=drawnull,doubleATR=drawnull,threeATR=drawnull,cfT=0,CFP=0,eckcON=0;//eckcON为二次开仓开关。
ATR:=ref(MA(tr,20),1);
abb:=(time0-timetot0(dynainfo(207))<=20) or not(islastbar);
mck:=(h-l)/ma(tr,20);
3G:=if(ref(holding,1)<0,hhv(ref(h,1),2),drawnull);
ll:if(cfT=0 and t<>0 and date[DATACOUNT]=date,t,drawnull),LINETHICK2,colorblue;
lll:if(cfP=0 and p<>0 and date[DATACOUNT]=date,p,drawnull),LINETHICK2,COLORBROWN;


///////////////////收盘和夜盘平仓模块//////////////////////////////////////////////////////////////////////////////
neipan:=STRNCMP(STKNAME,'螺纹',4)=0 or STRNCMP(STKNAME,'矿石',4)=0 or STRNCMP(STKNAME,'轧卷',4)=0 or
  STRNCMP(STKNAME,'焦炭',4)=0 or STRNCMP(STKNAME,'焦煤',4)=0 or STRNCMP(STKNAME,'玻璃',4)=0 or
  STRNCMP(STKNAME,'动力',4)=0 or STRNCMP(STKNAME,'鸡蛋',4)=0 or STRNCMP(STKNAME,'硅铁',4)=0 or
  STRNCMP(STKNAME,'锰硅',4)=0 or STRNCMP(STKNAME,'橡胶',4)=0 or STRNCMP(STKNAME,'玉米',4)=0 or
  STRNCMP(STKNAME,'淀粉',4)=0 ; //内盘品种
youse:=STRNCMP(STKNAME,'沪铜',4)=0 or STRNCMP(STKNAME,'沪锌',4)=0 or STRNCMP(STKNAME,'沪铝',4)=0 or
  STRNCMP(STKNAME,'沪镍',4)=0 or STRNCMP(STKNAME,'沪锡',4)=0 or STRNCMP(STKNAME,'沪铅',4)=0 ;
guijin:=STRNCMP(STKNAME,'白银',4)=0 or STRNCMP(STKNAME,'黄金',4)=0;
huanggongnongchan:=STRNCMP(STKNAME,'沥青',4)=0 or STRNCMP(STKNAME,'豆一',4)=0 or 
  STRNCMP(STKNAME,'塑料',4)=0 or STRNCMP(STKNAME,'豆粕',4)=0 or STRNCMP(STKNAME,'棕榈',4)=0 or
  STRNCMP(STKNAME,'聚氯',4)=0 or STRNCMP(STKNAME,'豆油',4)=0 or STRNCMP(STKNAME,'豆粕',4)=0 or
  STRNCMP(STKNAME,'聚丙',4)=0 or STRNCMP(STKNAME,'棉花',4)=0 or STRNCMP(STKNAME,'新菜',4)=0 or
  STRNCMP(STKNAME,'白糖',4)=0 or STRNCMP(STKNAME,'P',1)=0  or STRNCMP(STKNAME,'甲醇',4)=0 or
  STRNCMP(STKNAME,'菜粕',4)=0 ;

IFclose:=if(time=190000  or (time=050000 and youse) or (time=063000 and guijin) or
  (time=033000 and huanggongnongchan) or (time=030000 and strleft(stkname,4)='沥青'),1,0 );
  
if IFclose and abb and dynainfo(55)<>c and holding<0 then begin
 sellshort(1,holding,marketr);
 kzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
end
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 


//开空
if  l<=ll then begin
 if o>=ll and holding=0 and not(IFclose) then BEGIN 
  buyshort(1,ss,limitr,ll-mindiff*4);
  kzsATR:=ll+max(mindiff*2,ATR);
  doubleATR:=ll-ATR*2;
  threeATR:=ll-ATR*3;
 end
 cfT:=1;
end

if l<=lll then begin
 if  o>=lll and holding=0 and eckcON=1 and not(IFclose) then BEGIN 
  buyshort(1,ss,limitr,lll-mindiff*4);
  kzsATR:=lll+max(mindiff*2,ATR);
  doubleATR:=lll-ATR*2;
  threeATR:=lll-ATR*3;
  cfP:=1;
 end  
 if l<lll then cfP:=1;
end
 

 
//破3根K线最高价平仓
if  holding<0 and h>3G then BEGIN
  SELLSHORT(1,holding,marketr);
 kzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
 eckcON:=1;
end


 
//ATR止损
if holding<0 then begin
 if l<doubleATR then kzsATR:=min(kzsATR,ENTERPRICE+mindiff*4);//突破2倍ATR后下移止损
 if l<threeATR  then kzsATR:=min(kzsATR,ENTERPRICE+mindiff*2);//突破3倍ATR后下移止损
end

CorH:=if(enterbars=0 or kzsATR<ref(kzsATR,1),c,h);
if  CorH>kzsATR and holding<0 then BEGIn
 SELLSHORT(1,holding,marketr); 
 kzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
 eckcON:=1; 
end

 

//脉冲大K线平仓
ccl:=openint<ref(openint,1);
if  holding<0 and ccl and mck>5 and (c-l)>mindiff*2 then begin
 sellshort(1,holding,marketr);
 kzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
end

 

//日内全局变量归零处理
//if time=CLOSETIME(0) then eckcON:=0;

 
止损线:min(3G,kzsatr),colorred;


//调试
2atrr:doubleATR;
3atr:threeatr;
//qqqqq:EXTGBDATA('A1')

[此贴子已经被作者于2017/9/29 11:13:59编辑过]

 回到顶部
总数 13 1 2 下一页