Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIne Script - EMA into a 'Checkbox' Boolean input?

Tags:

pine-script

sorry for being such a newb and asking this silly question but does anyone know how to turn an EMA into a toggle switch (checkbox) input in TradingView?

Example - having an EMA 200 line drawn unto the chart and having the option to open the settings and toggling it On/OFF with a checkbox.

like image 485
Kris Avatar asked Jul 24 '26 07:07

Kris


1 Answers

Generally you can click the style tab in the settings menu and turn it off there.

Alternatively you could do the following:

showMA = input(title='Show EMA', type=input.bool, defval=true)

myEMA = ema(close, 200)

plot(showMA ? myEMA : na)
like image 200
bajaco Avatar answered Jul 26 '26 00:07

bajaco



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!