指标编写学习论坛

标题: n日内收盘涨幅平均值/n日内收盘跌幅平均值怎么编写? [打印本页]

作者: admin    时间: 2016-5-7 17:26
标题: n日内收盘涨幅平均值/n日内收盘跌幅平均值怎么编写?
n日内收盘涨幅平均值/n日内收盘跌幅平均值,怎么编写?
     正确答案::
      {input:n(13,1,999)}
      zf:=sum(if(c-ref(c,1)>0,(c-ref(c,1))/ref(c,1),0),n)/sum(c-ref(c,1)>0,n);
      f:=sum(if(c-ref(c,1)<0,(ref(c,1)-c)/ref(c,1),0),n)/sum(c-ref(c,1)<0,n);
      涨跌比:zf/df;  






欢迎光临 指标编写学习论坛 (http://shgm.net/) Powered by Discuz! X3.2