Is there a way to hide the choice of color in the "Style" section?

I’m using this code to display a price line and a table.

//@version=5
indicator('MyIndicator')

ticker = input.symbol(defval='NSE:NIFTY', title='Ticker')
ticker_col = input.color(color.new(color.blue, 0), title='Color')
tickertext_col = input.color(color.new(color.white, 0), title='Text')

ticker_data = request.security(ticker, "", close)
plot(ticker_data, title='Ticker', color=ticker_col, linewidth=1, style=plot.style_line)

table = table.new(position = position.top_right, columns = 3, rows = 4)
table.cell(table_id = table, column = 0, row = 1, text = 'Ticker', text_color = tickertext_col, text_size = size.normal, bgcolor = ticker_col)

Using the "Inputs" section, I can assign the same color to the price line and the background of the table, so I would like to remove the color option in the "Style" section, because it’s redundant and unuseful.

Is it feasible?

>Solution :

No, it is not possible.

However, as a workaround, you can set the editable argument of your plot() function to false. In that case, that plot wouldn’t appear in the style tab.

plot(ticker_data, title='Ticker', color=ticker_col, linewidth=1, style=plot.style_line, editable=false)

enter image description here

Leave a Reply