Search code examples
pine-scriptpine-script-v5trading

Is it possible to have a conditional pane indicator in pinescript?


I want to make an indicator that both applies some logic to the OHLC candles on the chart but also makes a pane where there is another indicator so a 2 in 1 indicator of some sorts for people with cheaper TradingView subscriptions. However i want the indicator that is on the pane to be conditional wether the user wants it or not. Is it possible in PineScript to only show the pane if the user agrees to it?

I tried using the ternary operator "?" to either display it or na however when doing this the pane is still there their just isnt any values inside of it, i want the pane completely gone if user does not agree to it


Solution

  • No, you cannot show/hide a pane via the script. All you can do is, as you did, to hide plots/drawings if the user does not enable that second indicator.