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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 有信号,不交易

   

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


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

主题:有信号,不交易

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/2/1 14:21:22    Post IP:101.90.124.141[只看该作者]

6楼的问题结合10楼,最好的解决方式凭经验,怎么处理?

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


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

以下是引用jinzhe在2016/1/29 8:56:44的发言:

图表信号和实际账户持仓没有关系,前面同根k线出开多平多信号以及走完k线下单导致的开多后来不及平仓,所以给了一个解决办法是在平仓条件里面加上enterbars>0

或者直接使用持仓同步功能



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/2/1 14:50:42    Post IP:101.90.124.141[只看该作者]

使用固定时间间隔,同根k线出开多平多信号,怎么能保证不重复开仓,也就是开仓后下一个动作就是平仓?若同时使用持仓同步能保证不重复开仓吗?


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


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

1没有信号闪烁就不会重复开仓,闪不闪烁你要观察一下

2同步持仓我前面说过了,是让图表信号和实际持仓一样,并没有你说的功能

3如何让交易依次进行,推荐使用orderqueue,比如:

buy(c>o,1,marketr),orderqueue;

sell(c<o,1,marketr),orderqueue;

 

代码里面的开平语句都加上

[此贴子已经被作者于2016/2/1 14:56:52编辑过]


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/3/17 12:38:22    Post IP:101.90.254.247[只看该作者]

止盈时不按信号执行,即程序规定盈利3-4个点后,保1个点盈利。而事实没有这样做,而是在下根K线走完才发出平仓信号,结果本来可以盈利的,却亏损了。当然前提我是选用了走完K线。

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160317122250.png
图片点击可在新窗口打开查看

有关程序如下:
sellshort(CROSS(H1,H2),0,marketr);

buy(CROSS(H1,H2) and holding=0,1,thisclose);

sell(CROSS(H2,H1) ,0,marketr);

buyshort(CROSS(H2,H1) and holding=0,1,thisclose);

多止损:sell(rounds(C,3)<rounds(ENTERPRICE,3)-15*MINDIFF,holding,marketr);

空止损:sellshort(rounds(C,3)>rounds(ENTERPRICE,3)+15*MINDIFF,holding,marketr);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+3*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+4*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+1*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+1*mindiff) and enterbars>0 then 多止盈1:sell(1,0, limitr,enterprice+1*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+5*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+6*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+3*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+3*mindiff) and enterbars>0 then 多止盈2:sell(1,0, limitr,enterprice+3*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+7*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+8*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+5*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+5*mindiff) and enterbars>0 then 多止盈3:sell(1,0, limitr,enterprice+5*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+9*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+10*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+7*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+7*mindiff) and enterbars>0 then 多止盈4:sell(1,0, limitr,enterprice+7*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+11*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+12*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+9*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+9*mindiff) and enterbars>0 then 多止盈5:sell(1,0, limitr,enterprice+9*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+13*mindiff and rounds(hhv(h,enterbars+1),3)<=rounds(enterprice,3)+14*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)+11*mindiff) and (rounds(l,3)<=rounds(enterprice,3)+11*mindiff) and enterbars>0 then 多止盈6:sell(1,0, limitr,enterprice+11*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-3*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-4*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-1*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-1*mindiff) and enterbars>0 then 空止盈1:sellshort(1,0, limitr,enterprice-1*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-5*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-6*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-3*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-3*mindiff) and enterbars>0 then 空止盈2:sellshort(1,0, limitr,enterprice-3*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-7*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-8*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-5*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-5*mindiff) and enterbars>0 then 空止盈3:sellshort(1,0, limitr,enterprice-5*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-9*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-10*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-7*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-7*mindiff) and enterbars>0 then 空止盈4:sellshort(1,0, limitr,enterprice-7*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-11*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-12*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-9*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-9*mindiff) and enterbars>0  then 空止盈5:sellshort(1,0, limitr,enterprice-9*mindiff);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-13*mindiff and rounds(llv(l,enterbars+1),3)>=rounds(enterprice,3)-14*mindiff  and  (rounds(h,3)>=rounds(enterprice,3)-11*mindiff) and (rounds(l,3)<=rounds(enterprice,3)-11*mindiff) and enterbars>0 then 空止盈6:sellshort(1,0, limitr,enterprice-11*mindiff);

if rounds(hhv(h,enterbars+1),3)>=rounds(enterprice,3)+15*mindiff and rounds(close,3)<=rounds(hhv(h,enterbars+1),3)-3*mindiff and enterbars>0 then 移动平多:sell(1,0,market);

if rounds(llv(l,enterbars+1),3)<=rounds(enterprice,3)-15*mindiff and rounds(close,3)>=rounds(llv(l,enterbars+1),3)+3*mindiff and enterbars>0 then 移动平空:sellshort(1,0,market);

if openprofit>=0 and time0>=(timetot0(closetime(0))- 2*60) then begin

收盘平多:sell(1,0,market);

收盘平空:sellshort(1,0,market);

time0<=timetot0(closetime(0))-2*60;

end;

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


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

说明上面的信号满足了你 的代码,并没有问题



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/3/17 13:45:03    Post IP:101.90.254.247[只看该作者]

我的本意是开仓按走完K线,平仓按程序

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


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

意思是要在走完k线下单的前提下,实现即时触发平仓?


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

客户服务部

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

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

 回到顶部
客人(101.90.*.*)
  19楼


  发帖心情 Post By:2016/3/17 14:25:22    Post IP:101.90.254.247[只看该作者]

是的老师   开平仓所有命令行的最后我已经加了orderqueue,还是与刚才一样(即15楼的)平仓按保留1跳在K线走完后发出命令,而不是满足条件后立即平仓的。

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


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

这个不行,代码无法在走完k线模式下实现即时触发下单


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

客户服务部

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

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

 回到顶部
总数 44 上一页 1 2 3 4 5 下一页