比如,
a1:=barslast(cross(ma(c,20),close));
我想求a2
a2:=ref(hhv(h,
100-a1),a1);
a3:ref(100-a1,a1),nodraw;
从a3的输出可见这种写法是错误的,原因我也知道。问题是a2应该怎么写?
求100天,但不包含最近数天(这个“数天”不是确定的常量,比如是a1)数据的最高点
[此贴子已经被作者于2016-9-1 17:07:14编辑过]
runmode:0;
a1:=barslast(cross(ma(c,20),close));
//ss:const(a1);
//a2:ref(hhv(h,100-ss),a1);
hh:=0;
h1:h;
for i=a1 to 100-a1 do begin
if h1[barpos-i]>hh then hh:=h1[barpos-i];
end
hh1:hh