Lipi Reference Lipi

Functions

input.bool()

Offers the reader a true-or-false setting and hands back what they chose. One of eleven input functions, one per kind of control. Only `defval` is required.

Syntax

                input.bool(const bool defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input bool
              

Arguments

defval required const bool The value the control starts at. Required.
title const string The label shown beside the control.
tooltip const string Help text for the control.
inline const string A key that puts several controls on one row. Controls sharing a key share a row.
group const string A heading the control sits under.
confirm const bool Asks the reader to confirm the value.

Return Type

input bool

Example


          indicator("Boolean Input Example", overlay=true)
showSMA = input.bool(true, title="Show SMA")
sma_value = talib.sma(close, 14)
plot(showSMA ? sma_value : na, title="SMA", color=color.blue, linewidth=2)