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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 这个cross怎么移到外面

   

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


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

主题:这个cross怎么移到外面

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


加好友 发短信
等级:黑侠 帖子:836 积分:0 威望:0 精华:0 注册:2014/12/26 11:47:55
这个cross怎么移到外面  发帖心情 Post By:2015/4/30 9:09:25    Post IP:121.13.65.239[只看该作者]

看了下移到外面的,不太会,这个cross怎么移到外面,帮改一下

 

if cross(h,r6) then
begin
buy(holding=0,tn,limitr,r6);
end
if cross(r7,l) then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cross(r5,l) then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cross(h,r5) then
begin
sellshort(1,0,limitr,r5);
end
end


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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2015/4/30 9:16:58    Post IP:58.246.57.26[只看该作者]

if aaa then begin

 if cross(x,y) then ......

end

 

改成

 

xx:=cross(x,y)

if aaa then begin

    if xx then .........

end

 

 

 

[此贴子已经被作者于2015/4/30 9:17:09编辑过]


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

客户服务部

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

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

 回到顶部
帅哥哟,离线,有人找我吗?
黄金精算师
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:836 积分:0 威望:0 精华:0 注册:2014/12/26 11:47:55
  发帖心情 Post By:2015/4/30 9:58:56    Post IP:121.13.65.239[只看该作者]

这一句改了,还是译不过

if cross(h,r6) then
begin

 

//-----------------------这出错
出错条件:=cross(h,r6);
if 出错条件 then
begin


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


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

cc:=cross(h,r6);

if cc then
begin

 

//-----------------------这出错
出错条件:=cc;
if 出错条件 then
begin



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

客户服务部

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

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

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


加好友 发短信
等级:黑侠 帖子:836 积分:0 威望:0 精华:0 注册:2014/12/26 11:47:55
  发帖心情 Post By:2015/4/30 10:17:45    Post IP:121.13.65.239[只看该作者]

这个也编不过

 回到顶部
帅哥哟,离线,有人找我吗?
黄金精算师
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:836 积分:0 威望:0 精华:0 注册:2014/12/26 11:47:55
  发帖心情 Post By:2015/4/30 10:19:21    Post IP:121.13.65.239[只看该作者]

单独能过,全部是这样的,帮看一下

input:n(13,1,20,1);

//中轴偏移值

input:m(70,-200,200,1);

//回撤止赢点数

input:m1(24,5,30,1);

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

r1:=barslast(day-ref(day,1)<>0);

r5:ref(o,r1)+0.1*m;
r6:r5+n;
r7:r5-n;

if time>091500 and time<150000 then
begin

if r1=0 and holding=0 then
begin
buy(h>r6,tn,limitr,r6);
buyshort(l<r7,tn,limitr,r7);
end
//-----------------------这出错
出错条件:=cross(h,r6);
if 出错条件 then
begin
buy(holding=0,tn,limitr,r6);
end
if cross(r7,l) then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cross(r5,l) then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cross(h,r5) then
begin
sellshort(1,0,limitr,r5);
end
end

//回撤止赢

r10:=enterbars;

r11:=llv(l,r10+1);

r12:=hhv(h,r10+1);
if time>091500 and time<150000 then
begin
if holding>0 and r12-c>m1 and r10>=1 then

begin

sell(1,0,thisclose);

end

if holding<0 and c-r11>m1 and r10>=1 then

begin

sellshort(1,0,thisclose);

end
end
//收盘前清仓
if time>=151000 then
begin
sellshort(holding<0,0,thisclose);
sell(holding>0,0,thisclose);
end

持仓:holding,colorwhite,linethick0;
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-1000000,noaxis,colorred

 


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


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

input:n(13,1,20,1);

//中轴偏移值

input:m(70,-200,200,1);

//回撤止赢点数

input:m1(24,5,30,1);

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

r1:=barslast(day-ref(day,1)<>0);

r5:ref(o,r1)+0.1*m;
r6:r5+n;
r7:r5-n;
cc:=cross(h,r6);
cc1:=cross(r7,l);
cc2:=cross(r5,l);
cc3:=cross(h,r5);
if time>091500 and time<150000 then
begin

if r1=0 and holding=0 then
begin
buy(h>r6,tn,limitr,r6);
buyshort(l<r7,tn,limitr,r7);
end
//-----------------------这出错
出错条件:=cc;
if 出错条件 then
begin
buy(holding=0,tn,limitr,r6);
end
if cc1 then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cc2 then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cc3 then
begin
sellshort(1,0,limitr,r5);
end
end

//回撤止赢

r10:=enterbars;

r11:=llv(l,r10+1);

r12:=hhv(h,r10+1);
if time>091500 and time<150000 then
begin
if holding>0 and r12-c>m1 and r10>=1 then

begin

sell(1,0,thisclose);

end

if holding<0 and c-r11>m1 and r10>=1 then

begin

sellshort(1,0,thisclose);

end
end
//收盘前清仓
if time>=151000 then
begin
sellshort(holding<0,0,thisclose);
sell(holding>0,0,thisclose);
end

持仓:holding,colorwhite,linethick0;
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-1000000,noaxis,colorred



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

客户服务部

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

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

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


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

一共有4个地方要改,而且没改的地方有提示的,请用户下次使用时多加用心,不要碰到问题就放弃


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

客户服务部

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

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

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


加好友 发短信
等级:黑侠 帖子:836 积分:0 威望:0 精华:0 注册:2014/12/26 11:47:55
  发帖心情 Post By:2015/4/30 10:33:41    Post IP:121.13.65.239[只看该作者]

哦,原来上面还有几个要写才行呀,谢谢

 回到顶部