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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 参数问题求助!

   

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


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

主题:参数问题求助!

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


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

公式全部代码如下:

input:ss(2,1,999,1),p(0,0,400000,1),wt(0,-20,20,1),tbzs(3,0,20,1);
VARIABLE:dzsATR=drawnull,doubleATR=drawnull,threeATR=drawnull,cfT=0,CFP=0,eckcON=0;//eckcON为二次开仓开关。
ATR:=if(tbzs=0,ref(MA(tr,20),1),(tbzs-1)*mindiff);
abb:=(time0-timetot0(dynainfo(207))<=20) or not(islastbar);
mck:=(h-l)/ma(tr,20);
3D:=if(ref(holding,1)>0,llv(ref(l,1),2),drawnull);
hh:if(cfT=0 and p<>0 and date[DATACOUNT]=date,p,drawnull),LINETHICK2,COLORRED;
hhh:if(cfP=0 and wt<>0 and eckcON=1 AND date[DATACOUNT]=date,p+wt*mindiff,drawnull),LINETHICK2,COLORRED;

 

//收盘和夜盘平仓
IFclose:=time=closetime(0) or (time=closetime(1) and closetime(1)<>141500);
if holding>0 and IFclose and abb and dynainfo(54)<>c then begin
 sell(1,holding,marketr);
 dzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
end


//开多
if  h>=hh then begin
 if o<=hh and holding=0 and not(IFclose) then BEGIN 
  buy(1,ss,limitr,hh+mindiff*4);
  dzsATR:=hh-ATR;
  doubleATR:=hh+ATR*2;
  threeATR:=hh+ATR*3;
 end
 cfT:=1;
end

if h>=hhh then begin
 if  o<=hhh and holding=0 and eckcON=1 and not(IFclose) then BEGIN 
  buy(1,ss,limitr,hhh+mindiff*4);
  dzsATR:=hhh-ATR;
  doubleATR:=hhh+ATR*2;
  threeATR:=hhh+ATR*3;
 end  
 if h>hhh then cfP:=1;
end

 

//破3根K线最低价平仓
if holding>0 and l<3D then BEGIN
   sell(1,holding,marketr);
 dzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
 eckcON:=1;
end
 
 
 
 //ATR止损
if holding>0 then begin
 if h>doubleATR then dzsATR:=max(dzsATR,ENTERPRICE-mindiff*4);//突破2倍ATR后上移止损
 if h>threeATR  then dzsATR:=max(dzsATR,ENTERPRICE-mindiff*2);//突破3倍ATR后上移止损
end

CorL:=if(enterbars=0 or dzsATR>ref(dzsATR,1),c,l);
if  CorL<dzsATR and holding>0 then BEGIN
 sell(1,holding,marketr);
 dzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
 eckcON:=1;
end  

 

//脉冲大K线平仓
ccl:=openint<ref(openint,1);
if  holding>0 and ccl and mck>5 and c<>h then begin
 sell(1,holding,marketr);
 dzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
end

if  holding>0 and  mck>7 and c<>h then begin
 sell(1,holding,marketr);
 dzsATR:=drawnull;
 doubleATR:=drawnull;
 threeATR:=drawnull;
end

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


止损线:max(dzsatr,3d),COLORGREEN;

//深绿色COLOR238e23
//调试
2atrr:doubleATR;
3atr:threeatr;


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