【发布时间】:2021-01-30 20:57:34
【问题描述】:
我想检查过去n 酒吧的条件。
因此,如果我想针对特定数字执行此操作,我将使用类似这样的方法,用于最后 5 个小节:
cond = close > open
conditions = cond and cond[1] and cond[2] and cond[3] and cond[4] and cond[5]
但我需要在函数内部使用此方法(用于自定义条形索引号返回)
我的意思是这样的:
check(condition,length)=>
for i = 1 to length
condition[bar_index] and condition[bar_index+i]
所以我可以像这样使用它:
check(close>open,5)
我希望答案是对还是错。
我尝试了更多循环,但我无法获得所需的循环。
请告诉我如何在带有for 循环的函数中使用它。
【问题讨论】:
标签: pine-script