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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助] 为什么平多以后 还是马上开多 怎么才能止损以后 不在开同向的仓 , 知道反向信号出现在开仓

   

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


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

主题:[求助] 为什么平多以后 还是马上开多 怎么才能止损以后 不在开同向的仓 , 知道反向信号出现在开仓

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


加好友 发短信
等级:新手上路 帖子:57 积分:0 威望:0 精华:0 注册:2013/6/27 19:07:44
[求助] 为什么平多以后 还是马上开多 怎么才能止损以后 不在开同向的仓 , 知道反向信号出现在开仓  发帖心情 Post By:2013/11/12 18:44:31    Post IP:118.187.65.155[只看该作者]

if barpos = 0 then
 stopprice := l - stopnum;
if aspect = 0 then begin
//多头处理
if l <= stopprice   then begin
 sell(holding>0,holding,0);

 aspect:= 1;
 stopprice := h+stopnum;
end
//处理移动的底部
if l - stopnum > stopprice then
 stopprice := l-stopnum;
end
if aspect = 1 then begin
//空头处理
if h >= stopprice then begin
 sellshort(holding<0,holding,0);


 aspect:= 0;
 stopprice := l-stopnum;
end
//处理移动的底部
if h + stopnum < stopprice then
 stopprice := h+stopnum;
end
dt:=Buy(开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0)  ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(开仓时间 and  NOT(TYPE(3)=1) and l<=LowerBand  and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;

     
if dt then begin

buy(dt and NOT(TYPE(1)=1),10%,0);
end;
if kt then begin

buyshort(kt and NOT(TYPE(1)=3),10%,0);
end;


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


加好友 发短信
等级:新手上路 帖子:57 积分:0 威望:0 精华:0 注册:2013/6/27 19:07:44
  发帖心情 Post By:2013/11/12 19:04:48    Post IP:118.187.65.155[只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:6h(%n$8ie9yl~15@5v5wnl2.jpg
图片点击可在新窗口打开查看

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


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

variable:n=0;

variable:m=0;

if barpos = 0 then
 stopprice := l - stopnum;
if aspect = 0 then begin
//多头处理
if l <= stopprice   then begin
 sell(holding>0,holding,0);

 aspect:= 1;
 stopprice := h+stopnum;

 n:=1;

 m:=0;
end
//处理移动的底部
if l - stopnum > stopprice then
 stopprice := l-stopnum;
end
if aspect = 1 then begin
//空头处理
if h >= stopprice then begin
 sellshort(holding<0,holding,0);


 aspect:= 0;
 stopprice := l-stopnum;

 m:=1;

 n:=0;
end
//处理移动的底部
if h + stopnum < stopprice then
 stopprice := h+stopnum;
end;


dt:=开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0);

kt:=开仓时间 and  NOT(TYPE(3)=1) and l<=LowerBand  and (HOLDING=0);   

 
if dt  and m=1 then begin

buy(1,10%,0);
end;
if kt  and n=1 then begin

buyshort(1,10%,0);
end;

 

 

这两句用来是干什么的?

dt:=Buy(开仓时间 AND NOT(TYPE(1)=1) and h>=UpperBand and (HOLDING=0)  ,lots,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
kt:=BuyShort(开仓时间 and  NOT(TYPE(3)=1) and l<=LowerBand  and (HOLDING=0) ,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;

这样的胡乱赋值有什么意义?

[此贴子已经被作者于2013/11/13 9:08:10编辑过]


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

客户服务部

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

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

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


加好友 发短信
等级:新手上路 帖子:57 积分:0 威望:0 精华:0 注册:2013/6/27 19:07:44
  发帖心情 Post By:2013/11/13 18:40:40    Post IP:218.60.6.110[只看该作者]

不好意思我新学的, 有的地方还是不太懂    现在又出来一个问题, if h >= stopprice then begin
 sellshort(holding<0,holding,0); 会平空  不在开空  但是 l <= stopprice  会开空    我的 策略是  最低价突破下轨做空  h >= stopprice  时平空 不在开仓 直到 最低价突破下轨在做空

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


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

l <= stopprice  上面代码里面哪里有根据这个判断条件开仓的?不都是l<=LowerBand  才开仓的?



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

客户服务部

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

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

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


加好友 发短信
等级:新手上路 帖子:57 积分:0 威望:0 精华:0 注册:2013/6/27 19:07:44
  发帖心情 Post By:2013/11/15 9:54:21    Post IP:218.60.6.110[只看该作者]

但是确实开仓啦? 没有在最低价突破下轨处开仓   却在  l <= stopprice  时开空了   

开仓时间:=time>opentime(1) and time<closetime(0);
平仓时间:=not(islastbar) and time=190000 or islastbar and currenttime>185905;
收盘平多:sell(平仓时间 and holding>0, 0, thisclose);
收盘平空:sellshort(平仓时间 and holding<0,0,thisclose);
variable:n=0;

variable:m=0;

if barpos = 0 then
 stopprice := l - stopnum;
if aspect = 0 then begin
//多头处理
if l <= stopprice   then begin
 sell(holding>0,holding,0);

 aspect:= 1;
 stopprice := h+stopnum;

 n:=1;

 m:=0;
end
//处理移动的底部
if l - stopnum > stopprice then
 stopprice := l-stopnum;
end
if aspect = 1 then begin
//空头处理
if h >= stopprice then begin
 sellshort(holding<0,holding,0);


 aspect:= 0;
 stopprice := l-stopnum;

 m:=1;

 n:=0;
end
//处理移动的底部
if h + stopnum < stopprice then
 stopprice := h+stopnum;
end;


dt:=开仓时间 AND NOT(TYPE(1)=1) and  h>=UpperBand and (HOLDING=0);

kt:=开仓时间 and  NOT(TYPE(3)=1) and l<=LowerBand  and (HOLDING=0);  

 
if dt  and m=1 then begin

buy(1,LOTS,LIMITR,Max(Open,UpperBand)+1*MINDIFF),orderqueue;
end;
if kt  and n=1 then begin

buyshort(1,lots,LIMITR,Min(Open,LowerBand)-1*MINDIFF),orderqueue;
end;
//画线

PARTLINE( aspect = 0, stopprice , colorrgb(255,0,0));

PARTLINE( aspect = 1, stopprice , colorrgb(0,255,0));

 

这是部分代码


此主题相关图片如下:搜狗截图13年11月15日0950_1.png
按此在新窗口浏览图片

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


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

没有代码是在l <= stopprice  条件下开仓的,

你觉得这个条件下开仓要么就是感觉错误,要么就是这个时候l<=LowerBand  也满足了



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

客户服务部

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

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

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


加好友 发短信
等级:新手上路 帖子:57 积分:0 威望:0 精华:0 注册:2013/6/27 19:07:44
  发帖心情 Post By:2013/11/15 9:59:46    Post IP:218.60.6.110[只看该作者]

哦   我明白了    改成最低价与下轨交叉时在开仓   不知道这样可行不  老师

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


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

if cross(LowerBand,stopprice) then buyshort(holding=0,1,market);

if cross(stopprice,UpperBand) then buy(holding=0,1,market);

 

在上面的策略里面加上这样的代码



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

客户服务部

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

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

 回到顶部