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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 公式编写

   

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


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

主题:公式编写

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


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

VARIABLE:bj=0;
nn1:=barslast((c-ref(c,1))/ref(c,1)>=0.03);
nn2:=barslast((ref(c,1)-c)/ref(c,1)>=0.03);

if (c-ref(c,1))/ref(c,1)>=0.03 then bj:=1;
if (ref(c,1)-c)/ref(c,1)>=0.03 then bj:=-1;

if bj=1 and nn1>0 and (c-ref(c,1))/ref(c,1)>0.01 then buy(holding=0,1,marketr);
if bj=1 and nn1>0 and c<=ref(ref(c,1)*1.015,nn1) then buyshort(holding=0,1,marketr);

if bj=-1 and nn2>0 and (ref(c,1)-c)/ref(c,1)>0.01 then buyshort(holding=0,1,marketr);
if bj=-1 and nn2>0 and c>-ref(ref(c,1)*0.985,nn2) then buy(holding=0,1,marketr);

if holding>0 and c<=hhv(h,enterbars+1)*1.015 then sell(1,0,marketr);
if holding<0 and c>=llv(l,enterbars+1)*0.985 then sellshort(1,0,marketr);



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

客户服务部

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

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

 回到顶部