Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide trades on chart, quantity and signal labels in code tradingview

Tags:

pine-script

I am looking for a way to hide: trades on the chart, quantity, and signal labels -

When using a pinescript strategy for trading view.

I want to do this in the code and not in the settings window. At the moment I have to uncheck the boxes every time I make a change to the script and I can't find the setting in the code or extra code to make this happen.

To uncheck the boxes each time I make a change in the script is....mweh...

Hopefully, someone can help me out with this seemingly simple issue. I have already spent quite a bit of time to figure this out...but no luck so far.

like image 801
Alexander Visser Avatar asked Jan 30 '26 06:01

Alexander Visser


1 Answers

According to the documentation, when you define a strategy, you can't set the default comment:

strategy(title, shorttitle, overlay, format, precision, scale, pyramiding, 
calc_on_order_fills, calc_on_every_tick, max_bars_back, backtest_fill_limits_assumption, default_qty_type,  
default_qty_value, initial_capital, currency, max_lines_count, 
max_labels_count, slippage, commission_type, commission_value, process_orders_on_close, 
close_entries_rule, margin_long, margin_short, max_boxes_count, explicit_plot_zorder) → void

so, the best workaround is override into the order with a space string in the comment:

strategy.entry("OverSelled", strategy.long, when = OVERSELLED_LONG, comment =' ' )
strategy.close("OverSelled",when=OVERSELLED_CLOSE,comment =' ')

NOTE: the quantities will remain in the chart

like image 195
Stefano Tinarelli Avatar answered Feb 02 '26 00:02

Stefano Tinarelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!