0
votes

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)

1

1 Answers

0
votes

No, defval of the input can be assigned only to a constant value known at the compile time of the script.