Reputation: 41
I have a custom script for Multiple EMA under a single indicator. Here's my sript:
//@version=4
//EMA
study("Multiple EMA", overlay=true)
plot(ema(close, 9), color = color.green, linewidth=2, title='9 EMA')
plot(ema(close, 18), color = color.red, linewidth=2, title='18 EMA')
plot(ema(close, 50), color = color.red, linewidth=2, title='50 EMA')
plot(ema(close, 100), color = color.red, linewidth=2, title='100 EMA')
plot(ema(close, 200), color = color.blue, linewidth=2, title='200 EMA')
I want to turn off/ uncheck the "9 EMA" and "18 EMA" plots from the "Style" window by default:
How can I achieve that using the Pine Editor?
Upvotes: 1
Views: 1509
Reputation: 21199
The plot()
function has an argument called display
. You can set it to display.none
so it will not be displayed initially.
plot(ema(close, 9), color = color.green, linewidth=2, title='9 EMA', display=display.none)
plot(ema(close, 18), color = color.red, linewidth=2, title='18 EMA', display=display.none)
Upvotes: 1