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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 帮忙编个程序

   

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


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

主题:帮忙编个程序

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


加好友 发短信
等级:论坛游民 帖子:106 积分:316 威望:0 精华:0 注册:2012/10/18 14:37:59
  发帖心情 Post By:2014/12/4 10:47:09    Post IP:220.191.226.140[只看该作者]

input:n(500,1,1000,1);
input:a(5,1,100,1);
input:m(10,1,200,1);
variable:bj=0;
tt:=time>92000 and (time0<timetot0(closetime(0))-300);
h20:ref(hhv(h,20),1);
l20:ref(llv(l,20),1);
if tt and h>h20 then begin
 sellshort(1,0,thisclose);
 buy(holding=0,n,thisclose);
end
if tt and l<l20 then begin
 sell(1,0,thisclose);
 buyshort(holding=0,n,thisclose);
end
if holding>0 and enterprice-l>a then 止损多:sell(1,0,thisclose);
if holding<0 and h-enterprice>a then 止损空:sellshort(1,0,thisclose);
if bj=0 and holding=n and h-enterprice>m then begin
 止盈多1:sell(1,n/2,thisclose);
 bj:=1;
end
if bj=1 and holding=n/2 and l<l20 then begin
 止盈后平多:sell(1,0,thisclose);
 止盈多后反手:buyshort(holding=0,n,thisclose);
 bj:=0;
end
if bj=0 and abs(holding)=n and enterprice-l>m then begin
 止盈平空:sellshort(1,n/2,thisclose);
 bj:=1;
end
if bj=1 and abs(holding)=n/2 and h>h20 then begin
 止盈后平空:sellshort(1,0,thisclose);
 止盈空后反手:buy(holding=0,n,thisclose);
 bj:=0;
end
if time0>=timetot0(closetime(0))-300 then begin
 收盘平仓空:sellshort(1,0,thisclose);
 收盘平仓多:sell(1,0,thisclose);
end


 回到顶部
总数 51 1 2 3 4 5 6 下一页