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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 请问怎么解决反手不开仓的问题

   

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


  共有3869人关注过本帖平板打印复制链接

主题:请问怎么解决反手不开仓的问题

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


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

if holding<>0 then begin
   sell(pd,0,limit,c),orderqueue;
   sellshort(pk,0,limit,c),orderqueue;
end

if holding=0 then begin
   buy(kd,1,limit,c),orderqueue;
   buyshort(kk,1,limit,c),orderqueue;
end

 

 

这样的顺序是不正确的,软件的公式编辑界面有说明是如何写的。而且,用户是不是不明白ORDERQUEUE是用来干什么的?加上来是不是为了好看?

 

dif:=ema(c,12)-ema(c,26);
dea:=ema(dif,9);
macd:=2*(dif-dea);
cpx:=ma(c,14);
entertime:=time<150000 and time>091600;
exittime:=time>=151400;
 
kd:=cross(c,cpx) and cpx>ref(cpx,1) and macd>0 and entertime;//开多条件
kk:=cross(cpx,c) and cpx<ref(cpx,1) and  macd<0 and entertime;//开空条件
pd:=(macd<0 and cpx<ref(cpx,1)) or exittime;//平多条件(如果开空条件成立,即使持有多单,马上平多开空
pk:=(macd>0 and cpx>ref(cpx,1)) or exittime;//平空条件(如果开多条件成立

 

if kd then begin

   sellshort(1,0,thisclose);

   buy(holding=0,1,thisclose);

end

 

if kk then begin

   sell(1,0,thisclose);

   buyshort(holding=0,1,thisclose);

end

 

if pd then sell(1,0,thisclose);

if pk then sellshort(1,0,thisclose);

 



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

客户服务部

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

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

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