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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → [交易系统]R-Breaker

   

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


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

主题:[交易系统]R-Breaker

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[交易系统]R-Breaker  发帖心情 Post By:2011/11/18 22:38:44 [只看该作者]

图片点击可在新窗口打开查看

 

runmode:0;

input:notbef(090000);
input:notaft(145500);
input:f1(0.35);
input:f2(0.07);
input:f3(0.25);
input:myreverse(1);
input:rangemin(0.2);
input:xdiv(3);

variable:ssetup=0;
variable:bsetup=0;
variable:senter=0;
variable:benter=0;
variable:bbreak=0;
variable:sbreak=0;
variable:ltoday=0;
variable:hitoday=999999;
variable:startnow=0;
variable:div=0;
variable:rfilter=false;

i_reverse:=myreverse*(callstock(stklabel,vtopen,6,0)/100);
i_rangemin:=rangemin*(callstock(stklabel,vtopen,6,0)/100);

if barpos=1 then begin
 startnow:=0;
 div:=max(xdiv,1);
end

hh:=ref(hitoday,1);
cc:=ref(close,1);
ll:=ref(ltoday,1);

if date>ref(date,1) then begin
 startnow:=startnow+1;
 
 ssetup:=hh+f1*(cc-ll);
 senter:=((1+f2)/2)*(hh+cc)-f2*ll;
 benter:=((1+f2)/2)*(ll+cc)-f2*hh;
 bsetup:=ll-f1*(hh-cc);
 bbreak:=ssetup+f3*(ssetup-bsetup);
 sbreak:=bsetup-f3*(ssetup-bsetup);
 
 hitoday:=high;
 ltoday:=low;
 
 rfilter:=hh-cc>=rangemin;
end

if high>hitoday then hitoday:=high;
if low<ltoday then ltoday:=low;

if time>=notbef and time<notaft and startnow>=2 and rfilter then begin
 if hitoday>=ssetup and holding>=0 then begin
  if low<=senter+(hitoday-ssetup)/div then begin
   sell(1,holding,limitr,senter+(hitoday-ssetup)/div);
   sellshort(1,1,limitr,senter+(hitoday-ssetup)/div);
  end 
 end
 
 if ltoday<=bsetup and holding<=0 then begin
  if high>=benter-(bsetup-ltoday)/div then begin
   if high>=benter-(bsetup-ltoday)/div then begin
    sellshort(1,holding,limitr,benter-(bsetup-ltoday)/div);
    buy(1,1,limitr,benter-(bsetup-ltoday)/div);
   end
  end
 end
 
 if holding<0 then begin
  if high-enterprice>=i_reverse then
   sellshort(1,enterprice+i_reverse);
 end
 
 if holding>0 then begin
  if enterprice-low>=i_reverse then
   sell(1,enterprice-i_reverse);
 end
 
 if holding=0 then begin
  if high>=bbreak then
   buy(1,bbreak);
 end
 
 if holding=0 then begin
  if low<=sbreak then
   sellshort(1,sbreak);
 end
end

if time>=notaft then begin
 if holding<0 then
  sellshort(1,holding,limitr,open);
  
 if holding>0 then
  sell(1,holding,limitr,open); 
end

盈亏:asset-500000,noaxis,coloryellow,linethick2;


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


加好友 发短信
等级:论坛游民 帖子:121 积分:446 威望:0 精华:0 注册:2010/7/28 15:47:11
  发帖心情 Post By:2011/11/20 8:48:30 [只看该作者]

什么周期?


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


加好友 发短信
等级:新手上路 帖子:80 积分:277 威望:0 精华:0 注册:2011/2/14 21:50:41
  发帖心情 Post By:2011/11/20 22:23:23 [只看该作者]

非常感谢z7c9版主!

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


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
  发帖心情 Post By:2012/6/12 13:54:44 [只看该作者]

rb强大


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


加好友 发短信
等级:论坛游民 帖子:178 积分:848 威望:0 精华:0 注册:2012/5/22 8:03:16
  发帖心情 Post By:2012/6/25 17:24:06 [只看该作者]

if holding=0 then begin
if high>=bbreak then
buy(1,bbreak);
end

if holding=0 then begin
if low<=sbreak then
sellshort(1,sbreak);
end
end

 

条件有问题,会产生不断的开平仓  >= 改为 >  把 <=改为<   现象消失, 不知符合愿意否?


 回到顶部
帅哥哟,离线,有人找我吗?
疾风游侠
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:14 积分:17 威望:0 精华:0 注册:2012/4/25 2:28:50
  发帖心情 Post By:2012/8/3 1:50:53 [只看该作者]

这帖子没人回啊?是有这个问题啊

 


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


加好友 发短信
等级:论坛游民 帖子:134 积分:715 威望:0 精华:0 注册:2010/9/7 23:46:57
  发帖心情 Post By:2012/8/9 17:16:20 [只看该作者]

 if hitoday>=ssetup and holding>=0 then begin//这里错误,应该是high
  if low<=senter+(hitoday-ssetup)/div then begin
   sell(1,holding,limitr,senter+(hitoday-ssetup)/div);
   sellshort(1,1,limitr,senter+(hitoday-ssetup)/div);
  end 
 end
 
 if ltoday<=bsetup and holding<=0 then begin//这里错误,应该是low
  if high>=benter-(bsetup-ltoday)/div then begin
   if high>=benter-(bsetup-ltoday)/div then begin//重复了
    sellshort(1,holding,limitr,benter-(bsetup-ltoday)/div);
    buy(1,1,limitr,benter-(bsetup-ltoday)/div);
   end
  end
 end
这样修改后,B-breaker就完善了。否则会出现锁仓的bug。

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


加好友 发短信
等级:新手上路 帖子:32 积分:195 威望:0 精华:0 注册:2012/9/28 22:27:41
  发帖心情 Post By:2012/9/28 23:46:42 [只看该作者]

公式里定义了

hitoday:=high;
ltoday:=low;

 

还会出现您说的问题吗???


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


加好友 发短信
等级:新手上路 帖子:32 积分:195 威望:0 精华:0 注册:2012/9/28 22:27:41
  发帖心情 Post By:2012/9/28 23:48:05 [只看该作者]

公式里定义了

hitoday:=high;
ltoday:=low;

还会出现您说的问题吗???

 
以下是引用Jamselizj在2012-8-9 17:16:20的发言:
 if hitoday>=ssetup and holding>=0 then begin//这里错误,应该是high
  if low<=senter+(hitoday-ssetup)/div then begin
   sell(1,holding,limitr,senter+(hitoday-ssetup)/div);
   sellshort(1,1,limitr,senter+(hitoday-ssetup)/div);
  end 
 end
 
 if ltoday<=bsetup and holding<=0 then begin//这里错误,应该是low
  if high>=benter-(bsetup-ltoday)/div then begin
   if high>=benter-(bsetup-ltoday)/div then begin//重复了
    sellshort(1,holding,limitr,benter-(bsetup-ltoday)/div);
    buy(1,1,limitr,benter-(bsetup-ltoday)/div);
   end
  end
 end
这样修改后,B-breaker就完善了。否则会出现锁仓的bug。


 回到顶部