没办法,你这个需求无法满足。它不符合序列变量计算处理的机制。
runmode:0;
input:cs(1.05,1,2,0.01);
ss:=0;
for i=barpos-1 downto 1 do BEGIN
if high[i]>high*cs then begin
ss:=barpos-i;
break;
end
end
ren:ss;
ren就是返回的数值,cs是幅度参数1.05就是5%
你可以将这个公式封装一个单独的公式,然后其他公式中以 用户函数 的模式进行调用