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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 关于代码 enterprice的问题

   

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


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

主题:关于代码 enterprice的问题

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


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


c1:=all(c>o,2) ;
c2:=c>ref(c,1);
c3:=any(c-o>a*mindiff,2);
c4:=all(h-c<a*mindiff,2);
c5:=all(vol>b,2);
c6:=c1 and c2 and c3 and c4 and c5;
c7:=time>091500 and time<162800;
c8:=barslast( h>enterprice+d*mindiff or l<enterprice-d*mindiff)>10;
variable:n=0;
variable:bjd=0;
variable:bjk=0;
if c7 and ref(c6,1)and n=0 and holding=0 then begin
 buy(holding=0,1,marketr);
 n:=1;
end

if ((L<ref(ref(llv(l,3),1),enterbars)) or (enterprice-l>=30)) and holding>0 then begin
 止损多:sell(1,0,marketr);
 bjd:=1;
end
c8:=barslast(( h>enterprice+d*mindiff) or (l<enterprice-d*mindiff))>10;
//if c7 and ref(c6,1) and n=1 and holding=0 and (barslast(bjd>0)>10 or barslast(BJK>0)>10  or (bjd=0 and bjk=0) ) then  buy(holding=0,1,marketr);
if c7 and ref(c6,1) and n=1 and holding=0 and (barslast(bjd>0 and ref(bjd,1)=0)>10  and bjk=0) then  buy(holding=0,1,marketr);
if c7 and ref(c6,1) and n=1 and holding=0 and (barslast(BJK>0 and ref(bjk,1)=0)>10  and bjd=0) then  buy(holding=0,1,marketr);
if c7 and ref(c6,1) and n=1 and holding=0 and (bjd>0 and BJK>0  and min(barslast(bjd>0 and ref(bjd,1)=0),barslast(BJK>0 and ref(bjk,1)=0))>10 ) then  buy(holding=0,1,marketr);
if c7 and ref(c6,1) and n=1 and holding=0 and (bjd=0 and bjk=0) then  buy(holding=0,1,marketr);
if holding>0 and hhv(h,enterbars+1)>enterprice+30 and c<enterprice  and holding>0 then begin
 sell(1,0,thisclose);
 bjd:=0;
end
if h>enterprice+d*mindiff then begin
 sell(1,0,marketr);
 bjd:=0;
end


if c7 and n=0 and holding=0 and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2) and all(c-l<a*mindiff,2) and all(vol>b,2),1) then begin
 buyshort(holding=0,1,marketr);
 n:=1;
end
if ((h>ref(ref(hhv(h,3),1),enterbars)) or (h-enterprice>=30)) and holding<0 then begin
 止损空:sellshort(1,0,marketr);
 bjk:=1;
end

c9:=barslast((h>ref(ref(hhv(h,3),1),enterbars)) or (h-enterprice>=30))>10;
//if c7 and n=1 and holding=0 and (barslast(bjd>0)>10 or barslast(BJK>0)>10  or (bjd=0 and bjk=0) )   and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2)  and all(c-l<a*mindiff,2) and all(vol>b,2),1) then begin buyshort(holding=0,1,marketr);
//end

if c7 and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2)  and all(c-l<a*mindiff,2) and all(vol>b,2),1) and n=1 and holding=0 and (barslast(bjd>0 and ref(bjd,1)=0)>10  and bjk=0) then  buyshort(holding=0,1,marketr);
if c7 and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2)  and all(c-l<a*mindiff,2) and all(vol>b,2),1) and n=1 and holding=0 and (barslast(BJK>0 and ref(bjk,1)=0)>10  and bjd=0) then  buyshort(holding=0,1,marketr);
if c7 and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2)  and all(c-l<a*mindiff,2) and all(vol>b,2),1) and n=1 and holding=0 and (bjd>0 and BJK>0 and min(barslast(bjd>0 and ref(bjd,1)=0),barslast(BJK>0 and ref(bjk,1)=0))>10 ) then  buyshort(holding=0,1,marketr);
if c7 and ref(all(c<o,2) and c<ref(c,1) and any(o-c>a*mindiff,2)  and all(c-l<a*mindiff,2) and all(vol>b,2),1) and n=1 and holding=0 and (bjd=0 and bjk=0) then  buyshort(holding=0,1,marketr);

if holding<0 and llv(l,enterbars+1)<enterprice-30 and c>enterprice and holding<0 then begin
 sellshort(1,0,thisclose);
 bjk:=0;
end
if l<enterprice-d*mindiff and holding<0 then begin 
 sellshort(1,0,marketr);
 bjk:=0;
end
if time0>=162900 then begin
    sell(holding>0,0,marketr);
    sellshort(holding<0,0,marketr);
end



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/21 11:54:09    Post IP:218.106.146.122[只看该作者]

辛苦老师了。我之前是哪里出了问题。

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


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

我忘记判断了多种情况,所以导致了代码不正确


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/21 14:23:12    Post IP:218.106.146.122[只看该作者]

现在这个代码够复杂的,我都有点看不懂了。


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


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

主要是之前的办法不适用了,你有多个平仓语句,并不只有一个止损语句。所以罗列出了4钟情况:

最近两次交易 :

1.一次多止损,一次空止损

2.一次多止损,一次正常平仓

3.一次空止损,一次正常平仓

4.两次正常平仓。

所以写了4句平仓



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/21 14:44:35    Post IP:218.106.146.122[只看该作者]

好的,辛苦老师。

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/21 14:46:46    Post IP:218.106.146.122[只看该作者]

两个K线同向,我想在第二根K线收盘的时候开仓,这个要怎么写,在第二根K线收盘的时候开仓,这个怎么写。

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


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

新问题请重新发帖


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/21 15:06:17    Post IP:218.106.146.122[只看该作者]

没事,你就在这里说一下

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/26 15:26:50    Post IP:218.106.146.122[只看该作者]

老师,为什么91楼的代码,没有办法做到止盈之后10周期之内都不开仓啊,

 回到顶部
总数 110 1.. 上一页 2 3 4 5 6 7 8 9 10 11 下一页