Ltp = input(title="Price", defval=15923, minval=1)
Here I want to add defval as dynamic based on the chart, when we switch other chart the last day closing price needs to be set automatically..
Is there any way to achieve this in pine script.
Note: defval should be dynamic (previous day close price / last Friday close price)