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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 换个浏览器,重新问

   

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


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

主题:换个浏览器,重新问

美女呀,离线,留言给我吧!
tomato
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:107 积分:0 威望:0 精华:0 注册:2014/3/6 8:26:00
换个浏览器,重新问  发帖心情 Post By:2014/3/19 16:15:31    Post IP:222.171.114.217[只看该作者]

初学金字塔,请各位老师挑错,日内,五分钟线,当前价格与之前两个不同周期的开盘价进行比较<!--EndFragment-->,否则卖出,并添加止损条件。
input:t(10,1,100,5),d(5);
一倍周期开盘价:=ref(open,t),noaxis,nodraw;
两倍周期开盘价:=ref(open,2*t),noaxis,nodraw;
//交易条件
开多条件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多条件:=time=185500 or l<enterprice-d*mindiff;
开空条件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空条件:=time=185500 or h>enterprice+d*mindiff;;
//交易系统
sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0,1,market);
sell(平多条件 and holding>0,holding,market);
buyshort(开空条件 and holding=0,1,market);
恳请各位好心人帮忙看看,不胜感激,
其中把止损离场和收盘前离场放在一起都用market,是不是可以?
而且在图表中发现有的K线上有两个信号既平空又开多,看着很不舒服,该如何改进

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


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

除了前面的close改h,close改l的

还要这样改

 

sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0 and exitbars>0,1,market);
sell(平多条件 and holding>0,holding,market);
buyshort(开空条件 and holding=0 and exitbars>0,1,market);


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

客户服务部

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

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

 回到顶部
美女呀,离线,留言给我吧!
tomato
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:107 积分:0 威望:0 精华:0 注册:2014/3/6 8:26:00
  发帖心情 Post By:2014/3/19 16:59:01    Post IP:222.171.114.217[只看该作者]

改完了,信号全没了,图片点击可在新窗口打开查看

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


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

input:t(10,1,100,5),d(5);
variable:n=0;
一倍周期开盘价:=ref(open,t),noaxis,nodraw;
两倍周期开盘价:=ref(open,2*t),noaxis,nodraw;
//交易条件
开多条件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多条件:=time=185500 or l<enterprice-d*mindiff;
开空条件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空条件:=time=185500 or h>enterprice+d*mindiff;;
//交易系统
 
if n=0 and 开多条件 and holding=0 then begin
  buy(1,1,market);
  n:=1;
end
if n=0 and 开空条件 and holding=0 then begin
  buyshort(1,1,market);
  n:=1;
end
sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0 and exitbars>0 and n=1,1,market);
sell(平多条件 and holding>0 ,holding,market);
buyshort(开空条件 and holding=0 and exitbars>0 and n=1,1,market);


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

客户服务部

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

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

 回到顶部
美女呀,离线,留言给我吧!
tomato
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:107 积分:0 威望:0 精华:0 注册:2014/3/6 8:26:00
  发帖心情 Post By:2014/3/20 8:13:43    Post IP:222.171.114.217[只看该作者]

谢谢啦,帮了大忙,赞哦~

 回到顶部
美女呀,离线,留言给我吧!
tomato
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:107 积分:0 威望:0 精华:0 注册:2014/3/6 8:26:00
  发帖心情 Post By:2014/3/21 10:49:12    Post IP:222.171.114.217[只看该作者]

请问版主,这么改的程序为什么有两个buy和buyshort发单动作
if n=0 and 开多条件 and holding=0 then begin
  buy(1,1,market);
  n:=1;
end
if n=0 and 开空条件 and holding=0 then begin
  buyshort(1,1,market);
  n:=1;
end
sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0 and exitbars>0 and n=1,1,market);
sell(平多条件 and holding>0 ,holding,market);
buyshort(开空条件 and holding=0 and exitbars>0 and n=1,1,market);


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


加好友 发短信
等级:超级版主 帖子:5895 积分:3774 威望:0 精华:0 注册:2012/1/1 0:00:01
  发帖心情 Post By:2014/3/21 11:04:17    Post IP:116.231.109.198[只看该作者]

一个开平仓条件也是可以的,您试试

 

input:t(10,1,100,5),d(5);
一倍周期开盘价:=ref(open,t),noaxis,nodraw;
两倍周期开盘价:=ref(open,2*t),noaxis,nodraw;
//交易条件
开多条件:=close>ref(open,t) and close>ref(open,2*t) and time<185500;
平多条件:=time=185500 or l<enterprice-d*mindiff;
开空条件:=close<ref(open,t) and close<ref(open,2*t)and time<185500;
平空条件:=time=185500 or h>enterprice+d*mindiff;;
sellshort(平空条件 and holding<0,holding,market);
buy(开多条件 and holding=0,1,market);
sell(平多条件 and holding>0 ,holding,market);
buyshort(开空条件 and holding=0 ,1,market);
[此贴子已经被作者于2014/3/21 11:13:00编辑过]


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

客户服务部

-----------------------------------------------------------

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

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com
 回到顶部
美女呀,离线,留言给我吧!
tomato
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:107 积分:0 威望:0 精华:0 注册:2014/3/6 8:26:00
  发帖心情 Post By:2014/3/21 11:15:28    Post IP:222.171.114.217[只看该作者]

如果这么写 信号就差好多,请问这里设置的全局变量n的作用是什么


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


加好友 发短信
等级:超级版主 帖子:5895 积分:3774 威望:0 精华:0 注册:2012/1/1 0:00:01
  发帖心情 Post By:2014/3/21 11:18:19    Post IP:116.231.109.198[只看该作者]

exitbars>0  这个影响的,这个导致您开平仓信号不会出现在同一根K线上

 

如果您要不在同一根k线开平仓,就是用原始的代码。



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

客户服务部

-----------------------------------------------------------

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

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