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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 逐k线计算改序列

   

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


  共有3030人关注过本帖树形打印复制链接

主题:逐k线计算改序列

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


加好友 发短信
等级:论坛游民 帖子:169 积分:0 威望:0 精华:0 注册:2016/8/28 16:11:16
逐k线计算改序列  发帖心情 Post By:2016/11/22 16:54:30    Post IP:119.138.154.73[显示全部帖子]


逐k线计算改序列,不知道哪函数通不过?

input:p(10,2,200,1);

input:length(75,10,300,10);

input:zs(4,1,50,1);

input:k1(4,1,50,1);

line:=ma(close,30);

tr1 :=max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));

atr:=ma(tr1,length); 

zsx:=ifelse(zs*ref(atr,1)<0.01*ref(c,1),0.01*ref(c,1),zs*ref(atr,1));

enterbars1:=enterbars+1;

dstop:=ref(l,1)-k1*ref(atr,1);//实时进多平仓价

kstop:=ref(h,1)+k1*ref(atr,1);//实时进空平仓价

dstop1:hhv(dstop,enterbars1);//平多价

kstop1:llv(kstop,enterbars1);//平空价


//建立多头的进场条件


    long:=cross(open,line);
 

   if long then begin

   tsellshort(tholding<0,0,mkt);

   //sellshort(holding<0,0,limitr ,open+mindiff);
   //sellshort(holding<0,0,marketr);

   tbuy(tholding=0,p,mkt);
   
   //if entrycond then begin

   //buy(holding=0,p, limitr ,open+mindiff);
   //end
   
   //buy(holding=0,p, marketr);

  end

//建立空头的进场条件

  
   short:= cross(line,open) ;

   if short then begin

   tsell(tholding>0,0,mkt);

   //sell(holding>0,0,limitr,open-mindiff);
   //sell(holding>0,0,marketr);

   tbuyshort(tholding=0,p,mkt);
   //if entrycond then begin

   //buyshort(holding=0,p,limitr,open-mindiff);
   //end
   //buyshort(holding=0,p,marketr);
  end

if tholding>0 and c<=max(enterprice-zsx,dstop1) then tsell(1,0,mkt);

if tholding<0 and c>=min(enterprice+zsx,kstop1) then tsellshort(1,0,mkt);


 回到顶部
帅哥哟,离线,有人找我吗?
tanyongde
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:169 积分:0 威望:0 精华:0 注册:2016/8/28 16:11:16
  发帖心情 Post By:2016/11/23 9:56:40    Post IP:119.138.154.73[显示全部帖子]

    你用的金字塔软件什么版本,我的软件信息显示不一样

 回到顶部