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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 老师 请问盈利10个点平仓

   

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


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

主题:老师 请问盈利10个点平仓

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


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

if c-enterprice>=10 and holding>0 then begin
sell(1,0,limitr,enterprice+10);
end
if enterprice-c>=10 and holding<0 then begin
sellshort(1,0,limitr,enterprice-10);
end


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游侠 帖子:509 积分:0 威望:0 精华:0 注册:2017/1/16 8:48:14
  发帖心情 Post By:2017/3/28 10:37:37    Post IP:221.0.140.101[只看该作者]

谢谢老师 还是你厉害。 麻烦老师看看接以上这种情况加上亏损10个点就止损应该怎么写

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


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

if c-enterprice>=10 and holding<0 then begin
sellshort(1,0,limitr,enterprice+10);
end
if enterprice-c>=10 and holding>0 then begin
sell(1,0,limitr,enterprice-10);
end


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游侠 帖子:509 积分:0 威望:0 精华:0 注册:2017/1/16 8:48:14
  发帖心情 Post By:2017/3/28 10:59:21    Post IP:221.0.140.101[只看该作者]

谢谢老师

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


加好友 发短信
等级:论坛游侠 帖子:509 积分:0 威望:0 精华:0 注册:2017/1/16 8:48:14
  发帖心情 Post By:2017/3/28 13:56:24    Post IP:221.0.140.101[只看该作者]

老师 本来只开平仓一次 因为有止盈止损了就会无数次开平仓 有什么方法可以出现止损平仓后本周期就不开仓了 只允许止盈后本周期才可以开仓。

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


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

把你现在完整的代码发一下,我直接对着现有的代码改


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游侠 帖子:509 积分:0 威望:0 精华:0 注册:2017/1/16 8:48:14
  发帖心情 Post By:2017/3/28 14:17:41    Post IP:221.0.140.101[只看该作者]

AR:=VALUEWHEN(A1>0,A1);
BR:=VALUEWHEN(B1>0,B1);
D8:=IF(C>AR,-1,IF(C<BR,1,0));
D9:=VALUEWHEN(D8<>0,D8);
G:=IF(D9=1,AR,BR);
SS:=1;/
if D9<=0 then begin
sellshort(1,holding,thisclose),orderqueue;
buy(holding=0,ss,thisclose),orderqueue;
end
if D9>0 then begin
sell(1,holding,thisclose),orderqueue;
buyshort(holding=0,ss,thisclose),orderqueue;
end
if c-enterprice>=5 and holding>0 then begin
sell(1,0,limitr,enterprice+5);
end
if enterprice-c>=5 and holding<0 then begin
sellshort(1,0,limitr,enterprice-5);
end

if c-enterprice>=5 and holding<0 then begin
sellshort(1,0,limitr,enterprice+5);
end
if enterprice-c>=5 and holding>0 then begin
sell(1,0,limitr,enterprice-5);
end

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


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

代码编译不通过



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游侠 帖子:509 积分:0 威望:0 精华:0 注册:2017/1/16 8:48:14
  发帖心情 Post By:2017/3/28 14:37:09    Post IP:221.0.140.101[只看该作者]

老师 这个能编译cond:=c<=ref(CLOSE,5);
ma5:=ma(c,5),
if cond then aa:ma5;
else bb:ma5;
partline(c<=ref(CLOSE,5),ma5, COLORGREEN),linethick1;
partline(c>ref(CLOSE,5),ma5,COLORred),linethick1;
cond1:=c<=ref(CLOSE,5);
ma10:=ma(c,10);
if cond1 then aa1:ma10;
else bb1:ma10;
partline(c<=ref(CLOSE,10),ma10, COLORGREEN),linethick1;
partline(c>ref(CLOSE,10),ma10,COLORred),linethick1;
cond2:=c<=ref(CLOSE,15);
ma15:=(ma(c,30)+ma(c,72))/2;
if cond2 then aa2:ma15;
else bb2:ma15;
partline(c<=ref(CLOSE,15),ma15, COLORGREEN),linethick1;
partline(c>ref(CLOSE,15),ma15,COLORred),linethick1;
variable:i=0,w=0;
kong:=c<ref(CLOSE,5)and c<ref(CLOSE,10)and c<ref(CLOSE,15);
duo:=c>ref(CLOSE,5and c>ref(CLOSE,10)and c>ref(CLOSE,15);
if kong then begin
i:=i+1;
w:=0;
end
if duo then begin
w:=w+1;
i:=0;
end
SS:=1;
 
if cross(w=1,0), then begin
sellshort(1,holding,thisclose),orderqueue;
buy(holding=0,ss,thisclose),orderqueue;
end
if cross(i=1,0) then begin
sell(1,holding,thisclose),orderqueue;
buyshort(holding=0,ss,thisclose),orderqueue;
end
if c-enterprice>=5 and holding>0 then begin ,
sell(1,0,limitr,enterprice+5);
end
if enterprice-c>=5 and holding<0 then begin
sellshort(1,0,limitr,enterprice-5);
end

if c-enterprice>=10 and holding<0 then begin /
sellshort(1,0,limitr,enterprice+10);
end
if enterprice-c>=10 and holding>0 then begin
sell(1,0,limitr,enterprice-10);
end

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


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

VARIABLE:bj=0;
cond:=c<=ref(CLOSE,5);
ma5:=ma(c,5);
if cond then aa:ma5;
else bb:ma5;
partline(c<=ref(CLOSE,5),ma5, COLORGREEN),linethick1;
partline(c>ref(CLOSE,5),ma5,COLORred),linethick1;
cond1:=c<=ref(CLOSE,5);
ma10:=ma(c,10);
if cond1 then aa1:ma10;
else bb1:ma10;
partline(c<=ref(CLOSE,10),ma10, COLORGREEN),linethick1;
partline(c>ref(CLOSE,10),ma10,COLORred),linethick1;
cond2:=c<=ref(CLOSE,15);
ma15:=(ma(c,30)+ma(c,72))/2;
if cond2 then aa2:ma15;
else bb2:ma15;
partline(c<=ref(CLOSE,15),ma15, COLORGREEN),linethick1;
partline(c>ref(CLOSE,15),ma15,COLORred),linethick1;
variable:i=0,w=0;
kong:=c<ref(CLOSE,5)and c<ref(CLOSE,10)and c<ref(CLOSE,15);
duo:=c>ref(CLOSE,5) and c>ref(CLOSE,10)and c>ref(CLOSE,15);
if kong then begin
i:=i+1;
w:=0;
end
if duo then begin
w:=w+1;
i:=0;
end
SS:=1;
 
if cross(w=1,0) then begin
sellshort(1,holding,thisclose),orderqueue;
buy(holding=0 and bj=0,ss,thisclose),orderqueue;
end
if bj=1 and  cross(w=1,0) and holding=0 and exitbars>0 then begin
 buy(1,ss,thisclose);
 bj:=0;
end
if cross(i=1,0) then begin
sell(1,holding,thisclose),orderqueue;
buyshort(holding=0 and bj=0,ss,thisclose),orderqueue;
end
if bj=1 and  cross(i=1,0) and holding=0 and exitbars>0 then begin
 buyshort(1,ss,thisclose);
 bj:=0;
end

if c-enterprice>=5 and holding>0 then begin
sell(1,0,limitr,enterprice+5);
end
if enterprice-c>=5 and holding<0 then begin
sellshort(1,0,limitr,enterprice-5);
end


if c-enterprice>=10 and holding<0 then begin
sellshort(1,0,limitr,enterprice+10);
bj:=1;
end
if enterprice-c>=10 and holding>0 then begin
sell(1,0,limitr,enterprice-10);
bj:=1;
end



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

客户服务部

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

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

 回到顶部
总数 20 上一页 1 2