wayan
wayan

Reputation: 33

How to make a plot invisible by default in pinescript

Clicking on the cogwheel 'settings' of an indicator on a chart pops up a dialog with a tab 'inputs' and a tab 'style'. Every style is preceded by a checkbox that controls the visibility of that particular plot. By default, all plots are visible. I want some plots to be hidden by default. The only way I know to do this is to manually uncheck some styles in the dialog, and then save these settings as the new default with the dropdownbox 'default' > 'save as default'. But how can I do this in code? How can I set the default state of a plot to 'hidden' with pinescript? thanks!

Upvotes: 2

Views: 6992

Answers (2)

Daria
Daria

Reputation: 74

You can use display.none for display parameter. For example:

plot(ema(close,200), title="EMA 200", color=color.red, display=display.none)

Upvotes: 6

Mayank Jain
Mayank Jain

Reputation: 3195

a=false
plot(1, color=(a ? color.red : na))

I could also not figure this out... until I figured it out.

Upvotes: 0

Related Questions