if 条件 then
周期= 当前周期
end
过了N周期后
if 条件 then
高点 = 周期往前 5分钟内的高点
end
//框架大致这样,中间条件自己改下吧
条件:=mod(barpos,3)=1 and barpos>3;
variable:cond=0;
variable:周期=0;
if 条件 and cond=0 then
begin
周期:= barpos;
cond:=1;
end
zz:周期;
zz2:cond;
dd:hhv(high,3);
aa:=ref(hhv(high,3),barpos-周期);
if 条件 and barpos>周期 and cond=1 then
begin
高点: aa;
cond:=0;
end
楼上你写这么复杂干嘛,你们有函数 HHVBARS LLVBARS
楼主求大概就是这样效果吧
他是某个条件成立记住那根k,然后在后面什么时候去调用前面那根k的hhv。和你则个有出入吧