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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 我的一个日内交易策略,求助编程程序

   

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


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

主题:我的一个日内交易策略,求助编程程序

帅哥哟,离线,有人找我吗?
阿火
  11楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/11/17 19:43:29 [只看该作者]

很简单的程序。但是撤单追单那一部分,要用后台实现

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


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/11/17 21:31:54 [只看该作者]

今晚比较闲,给楼主一个答案:

别看代码多,为了使结构清晰化,多用了begin……end,其实逻辑很简单

variable:hl=0,cc=0,kcj=0,zs=0;
cond:=date<>ref(date,1);
nn:=barslast(cond)+1;
hi:=ref(hhv(h,nn),1);
lo:=ref(llv(l,nn),1);
entertime:=time>93000 and time<145800 and hi-lo<=250;

if time>=145800 then begin
 sell(holding>0,1,limitr,o);
 sellshort(holding<0,1,limitr,o);
 cc:=0;
end

if holding>0 then begin
 多盈:kcj+80;
 多损:zs;
end

if holding<0 then begin
 空盈:kcj-80;
 空损:zs;
end

if holding>0 and l<zs then begin
 sell(1,1,limitr,min(o,zs-mindiff));
 cc:=0;
end

if holding<0 and h>zs then begin
 sellshort(1,1,limitr,max(o,zs+mindiff));
 cc:=0;
end

if holding>0 and h>kcj+80 then begin
 sell(1,1,limitr,kcj+80);
 cc:=0;
end

if holding<0 and l<kcj-80 then begin
 sellshort(1,1,limitr,kcj-80);
 cc:=0;
end

if holding=0 and time<145800 and cc>0 and l<hl-50 then begin
 buy(1,1,limitr,hl-50);
 kcj:=hl-50;
 zs:=kcj-75;
 hl:=kcj;
 if l<zs then begin

  sell(1,1,limitr,zs-mindiff);

  cc:=0;

 end
 goto quit@;
end

if holding=0 and time<145800 and cc<0 and h>hl+50 then begin
 buyshort(1,1,limitr,hl+50);
 kcj:=hl+50;
 zs:=kcj+75;
 hl:=kcj;
 if h>zs then begin

  sellshort(1,1,limitr,zs+mindiff);

  cc:=0;

 end
 goto quit@;
end

if holding>0 and h>hl then begin
 hl:=h;
 if hl-kcj>50 then zs:=kcj;
end

if holding<0 and l<hl then begin
 hl:=l;
 if kcj-hl>50 then zs:=kcj;
end

if cc=0 and entertime and h>hi then begin
 cc:=1;
 hl:=h;
end

if cc=0 and entertime and l<lo then begin
 cc:=-1;
 hl:=l;
end

if cc>0 and h>hl then hl:=h;
if cc<0 and l<hl then hl:=l;
quit@;

[此贴子已经被作者于2011-11-17 21:56:58编辑过]

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


加好友 发短信
等级:论坛游民 帖子:129 积分:473 威望:0 精华:0 注册:2011/12/6 14:06:35
  发帖心情 Post By:2011/12/19 16:58:54 [只看该作者]

谢谢斑竹

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