这是演示问题的简单测试:
//@version=4
study("Triangle",overlay=false)
length=input(title="Length",type=input.integer,defval=244)
long=input(title="Distance from 1 high",type=input.integer,defval=80)
x1=int(0)
x1:=-1*highestbars(length)>long?-1*highestbars(length):0
plot(x1,color=color.purple)
用途:
h = highestbars(length)
x1:=-1*h>long?-1*h:0
并且请参阅Why do some functions and built-ins evaluate incorrectly in if or ternary (?) blocks?以获取说明。