I'm trying to code a dynamic hline in tradingview pinescript so that the hline value changes depending on price, volume, rsi etc etc. below is an example of a hline thats not dynamic:
userinput = input.int(10, "value)
hline(userinput, title = "title", color = color.new(#ffffff, 0), linestyle = hline.style_dotted, linewidth = 1)
What I'd like is for the hline to be dynamic instead of being user defined, for example:
dynamicvalue = math.avg(variable, anothervariable)
hline(dynamicvalue, title = "dynamic title", color = color.new(#ffffff, 0), linestyle = hline.style_dotted, linewidth = 1)
