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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 横盘突破策略编程求助

   

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


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

主题:横盘突破策略编程求助

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/3/24 10:03:07 [只看该作者]

MID :=  MA(CLOSE,26);
UPPER:= MID +2*STD(CLOSE,26);
LOWER:= MID -2*STD(CLOSE,26);
t1:=time>093000;
variable:yidong=0;
cond_duo:= (upper-lower)<ref(upper-lower,1)  and ref(h<=mid+8*mindiff or l>=mid-8*mindiff ,1) and h>mid+12*mindiff and h>ref(hhv(h,todaybar),1);
cond_kong:= (upper-lower)<ref(upper-lower,1) and ref(h<=mid+8*mindiff or l>=mid-8*mindiff ,1) and l<=mid-12*mindiff and l<ref(llv(l,todaybar),1);

nn:=barslast(cond_duo);
hh:=valuewhen(cond_duo,h);
nn1:=barslast(cond_kong);
ll:=valuewhen(cond_kong,l);
max_yingli:=hhv(openprofit,enterbars+1);

 

if ref(nn>=0 and count(c<o,nn+1)>0,2) and all(c>o,2) and holding=0 and t1 then begin
  buy(holding=0,1,market);
  yidong:=hh;
end

if holding>0 and h-enterprice>=6*mindiff and h-enterprice<=10*mindiff and enterbars>0 and l<enterprice then 移动多1:sell(1,0,market);

if holding>0 and h-enterprice>10*mindiff and h-enterprice<=20*mindiff and openprofit<=0.5*max_yingli and enterbars>0 then 移动多2:sell(1,0,market);
if holding>0 and h-enterprice>20*mindiff and openprofit<=0.3*max_yingli and enterbars>0 then 移动多3: sell(1,0,market);

if ref(nn>=0 and count(c>o,nn+1)>0,2) and all(c<o,2)  and t1  and holding=0 then begin
 buyshort(holding=0,1,market);
 yidong:=ll;
end

if holding<0 and enterprice-l>=6*mindiff and enterprice-l<=10*mindiff and enterbars>0 and h>enterprice then 移动空1: sellshort(1,0,market);
if holding>0 and enterprice-l>10*mindiff and enterprice-l<=20*mindiff and openprofit<=0.5*max_yingli and enterbars>0 then 移动空2:sellshort(1,0,market);
if holding>0 and enterprice-l>20*mindiff and openprofit<=0.3*max_yingli  and enterbars>0 then 移动空3: sellshort(1,0,market);


if l<yidong and enterbars>0 then 固定多: sell(1,0,market);
if h>yidong and enterbars>0 then 固定空: sellshort(1,0,market);



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部