I am trying to set the default value in the input field to be a certain starting value based on the marketcap of the security. I can't get it to work. There is a problem with the series and it's keeping the first constant definition fixed. Defining a variable also doesn't work. What is the correct way to do this? I want to be able to set "acc" to be a certain value based on the size of the marketcap. Here in this example I have simplified it to see if its working.
//@version=5
indicator("Factor", overlay=true, timeframe="", timeframe_gaps=true)
_Outstanding = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
_close = close
_mv = _Outstanding * _close
acc = 5.0
if _mv >= 1.0
acc = 10.0
else
acc = 2.0
atrfactor = input.float(acc, "factor", minval = 1.0, step = 0.1)
plotchar(_mv, "MV", "", location = location.top)