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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → [分享]2分钟boll日内交易系统(附源码)

   

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


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

主题:[分享]2分钟boll日内交易系统(附源码)

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


加好友 发短信
等级:论坛游侠 帖子:236 积分:0 威望:0 精华:0 注册:2014/7/25 11:07:59
  发帖心情 Post By:2014/11/4 16:16:28 [只看该作者]

为什么这个代码 ,在2分股指上,看不到任何交易信号 ?呵呵
代码如下对吗?

//========================================================
//交易控制变量
variable:a1=1;
variable:a2=1;

//**********************************
//交易手数:
tn:=1;

//最大持仓量
cx:=6;

//提前下单量(秒)
xd:=3;

//交易时间区间
p1:=time>091500 and time<151000;
p2:=if(islastbar,dynainfo(207),time);
p3:=time0-timetot0(p2),linethick0;

//********************************
r1:=barslast(date<>ref(date,1));
r2:=ref(o,r1);

//********************************
hd:=if(islastbar,3,1.2);
hd1:=if(islastbar,3,0.1);

//********************************
cc:=(h+l+o+c)/4;
mid:=ma(cc,26);
upper:=mid+1.7*std(cc,26);
lower:=mid-1.7*std(cc,26);

//********************************
r12:=asset-ref(asset,135);
r13:=valuewhen(r1=134,r12);

if r13>6000*cx and a2>0 then 
begin
a1:=barpos;
a2:=-1;
end
r16:=if(barpos-a1>810,1,-1);
if r16>0 and r1<2 then a2:=1;

if abs(r2-c)>34 or (abs(r2-c)>24 and r1<40) then c6:=1;
r17:=r16>0 or c6>0;
//********************************
q2:=valuewhen(r1=0,sum(h-l,270)/270);
r20:=upper-lower<6.5*q2;

//********************************
nn:=4*q2;
if holding>0 and o-l>=nn and enterbars>0 then
begin
sell(holding>0,holding,limitr,o-nn-hd);
end
if holding<0 and h-o>=nn and enterbars>0 then
begin
sellshort(holding<0,abs(holding),limitr,o+nn+hd);
end

//********************************
if c>upper and r20 and h-upper<3.5*q2 and p1 and p3<=xd and r17>0 then
begin
buy(holding<cx,tn,limitr,c+hd1);
end
if c<lower and r20 and lower-l<3.5*q2 and p1 and p3<=xd and r17>0 then
begin
buyshort(abs(holding)<cx,tn,limitr,c-hd1);
end

//---------------------------------
if holding>0 and l<mid then
begin
sell(1,0,limitr,c-hd1);
end
if holding<0 and h>mid then
begin
sellshort(1,0,limitr,c+hd1);
end

//********************************
//收盘前清仓
if p2>=151300 then
begin
sellshort(holding<0,0,limitr,c+hd1);
sell(holding>0,0,limitr,c-hd1);
c6:=-1;
c1:=1;
end

 回到顶部
总数 31 1 2 3 4 下一页