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


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

   

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


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

主题:有信号,不交易

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
有信号,不交易  发帖心情 Post By:2015/12/10 16:21:07    Post IP:101.90.126.219[显示全部帖子]

 

开多:buy(CROSS(H1,H2)&&COUNT(ENTERBARS=1,N)<25&&TIME>=0920&&TIME<1440 and holding=0 ,1,thisclose);

开空:buyshort(CROSS(H1,H2)&&COUNT(enterbars=1,N)<25&&TIME>=0920&&TIME<1440 and holding=0 ,1,thisclose);


平空:sellshort(CROSS(H1,H2)&&COUNT(enterbars=1,N)<25 and holding>0 ,1,thisclose);

平多:sell(CROSS(H2,H1)&&COUNT(enterbars=1,N)<25 and holding<0,1,thisclose);


sell(C<ENTERPRICE-12*MINDIFF,holding,marketr);

sellshort(C>ENTERPRICE+12*MINDIFF,holding,marketr);


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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2015/12/10 16:28:48    Post IP:180.168.5.243[显示全部帖子]

盘整函数怎样才能发挥作用,又不影响抓住行情?请帮助分析下面语句:

 

CROSS(H1,H2)&&COUNT(BARSBK=1||BARSSK=1,N)<30&&TIME>=0920&&TIME<1450&&PANZHENG=0,BPK;
CROSS(H2,H1)&&COUNT(BARSBK=1||BARSSK=1,N)<30&&TIME>=0920&&TIME<1450&&PANZHENG=0,SPK;

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/28 16:41:02    Post IP:101.90.125.109[显示全部帖子]

老师你好,谢谢帮助修改。
问题:
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160128162758.png
图片点击可在新窗口打开查看
1、设置采用的是走完一根K线开仓,平仓采用 marketr和limitr价格形式,而程序是在走完一根K线开仓的,平仓信号却在走完一根K线前发出了,所以这种情况下,造成该笔开仓不能被平仓,或一直持有,或与下次同方向平仓信号时才能平仓。
例如:今天13::15信号显示开多并多止盈,其实是该根K线结束后以1924点开了多单,并没有多止盈,这个多单一直持有。在13:20以1920.8点只是空开,不再平多单,并且这个空单下笔也不平仓。如此,这样有一笔多单一直持有至收盘,亏损巨大。
2、多止损25个点不起作用。
有关程序如下:

平空:sellshort(BB10>1 AND AA10>REF(AA10,1) ,0, marketr);
if BB10>1 AND AA10>REF(AA10,1)  and holding=0 and bjd=0 then begin
    buy(1,1, marketr);
    bjd:=1;
    bjk:=0;
end
平多:sell(BB10<1 AND AA10<REF(AA10,1) ,0,marketr);
if BB10<1 AND AA10<REF(AA10,1)  and holding=0 and bjk=0 then begin
    buyshort(1,1,marketr);
    bjk:=1;
    bjd:=0;
end

多止损:sell(C<ENTERPRICE-25*MINDIFF,holding,marketr);
空止损:sellshort(C>ENTERPRICE+25*MINDIFF,holding,marketr);

if hhv(h,enterbars+1)>=enterprice+10*mindiff and hhv(h,enterbars+1)<=enterprice+15*mindiff  and  (h>=enterprice+5*mindiff) and (l<=enterprice+5*mindiff)  then 多止盈1:sell(1,0, limitr,enterprice+5*mindiff);
if hhv(h,enterbars+1)>=enterprice+16*mindiff  and hhv(h,enterbars+1)<=enterprice+20*mindiff  and  (h>=enterprice+10*mindiff) and  (l<=enterprice+10*mindiff)  then 多止盈2:sell(1,0, limitr,enterprice+10*mindiff);
if llv(l,enterbars+1)<=enterprice-10*mindiff  and llv(l,enterbars+1)>=enterprice-15*mindiff  and (h>=enterprice-5*mindiff) and (l<=enterprice-5*mindiff)  then 空止盈1:sellshort(1,0, limitr,enterprice-5*mindiff);
if llv(l,enterbars+1)<=enterprice-16*mindiff  and llv(l,enterbars+1)>=enterprice-20*mindiff  and (h>=enterprice-10*mindiff) and (l<=enterprice-10*mindiff)  then 空止盈2:sellshort(1,0, limitr,enterprice-10*mindiff);
 
if hhv(h,enterbars+1)>=enterprice+21*mindiff and close<=hhv(h,enterbars+1)-3*mindiff then 移动平多:sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-21*mindiff and c>=llv(l,enterbars+1)+3*mindiff then 移动平空:sellshort(1,0,market);

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/28 17:37:22    Post IP:101.90.125.109[显示全部帖子]

3楼是一个单独的问题,与1楼、2楼无关。
例如:3楼的图片中(在图片中间位置)的第一个买入(红箭头)今天IH50股指上证501602在13::15信号显示开多并多止盈,其实是该根K线结束后以1924点开了多单,并没有多止盈,这个多单一直持有。其后在13:20以1920.8点只是空开,不再平多单,并且这个空单下笔也不平仓。如此,这样有一笔多单一直持有至收盘,亏损巨大。
这些是已经结合日志才看到的结果。

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/29 10:23:34    Post IP:101.90.253.246[显示全部帖子]

直接使用持仓同步功能怎么设置?可以实现同根k线出开多平多信号并真实实现吗?谢谢


 回到顶部
帅哥哟,离线,有人找我吗?
Mikewang
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | 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楼,最好的解决方式凭经验,怎么处理?

 回到顶部
帅哥哟,离线,有人找我吗?
Mikewang
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | 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线出开多平多信号,怎么能保证不重复开仓,也就是开仓后下一个动作就是平仓?若同时使用持仓同步能保证不重复开仓吗?


 回到顶部
帅哥哟,离线,有人找我吗?
Mikewang
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | 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;

 回到顶部
帅哥哟,离线,有人找我吗?
Mikewang
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | 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线,平仓按程序

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/3/17 14:40:25    Post IP:101.90.254.247[显示全部帖子]

程序的命令是开仓按走完K线,平仓实时执行的。怎么实现这个目的?

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