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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 编写模型后运行显示不对

   

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


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

主题:编写模型后运行显示不对

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


加好友 发短信
等级:新手上路 帖子:17 积分:0 威望:0 精华:0 注册:2014/7/25 14:30:35
  发帖心情 Post By:2014/10/23 17:35:48 [只看该作者]

就只有m一个参数,就是算atr的那个的而已;



input:m(20,1,100,1);

TR1 := MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR := MA(TR1,m);


h14:ref(hhv(h,14),1);
l14:ref(llv(l,14),1);








开多h1:buy( cross(h,h14) and holding=0 ,ss,limitr,max(h14,o)+3*MINDIFF);
开空l1:buyshort( cross(l14,l) and holding=0   ,ss,limitr,min(l14,o)-3*mindiff);

开多h3:buy(  cross(h,h14) and holding=0  ,ss,limitr,max(h14,o)+3*mindiff);
开空l3:buyshort((  cross(l14,l)) and holding=0   ,ss,limitr,min(l14,o)-3*mindiff);
多止盈1:h-(ENTERPRICE-mindiff)-2*ref(atr,1),noaxis;
多止损1:(enterprice+mindiff)-l-ref(atr,1),noaxis;
多止盈:sell(h-(ENTERPRICE-mindiff)>2*ref(atr,1) and type(1)=2 and enterbars>0,0,limitr,min(enterprice+2*ref(atr,1)-mindiff,o));
空止盈:sellshort((enterprice-mindiff)-l>2*ref(atr,1) and type(1)=3 and enterbars>0,0,limitr,max(enterprice-mindiff-2*ref(atr,1),o));
多止损:sell((enterprice+mindiff)-l>ref(atr,1) and type(1)=2 and enterbars>0,0,limitr,min(enterprice+mindiff-ref(atr,1),o));
空止损:sellshort(h-(ENTERPRICE+mindiff)>ref(atr,1) and type(1)=3 and enterbars>0,0,limitr,max(enterprice+ref(atr,1)+mindiff,o));
利润:NETPROFIT,NOAXIS,LINETHICK2,colorred;
最大回撤:maxdrawdown,noaxis;
平均亏损:avgloss,noaxis;

 回到顶部