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.
input.bool(const bool defval, const string title, const string tooltip, const string inline, const string group, const bool confirm) → input bool| Parameter | Type | Required | Description |
|---|---|---|---|
defval | const bool | yes | The value the control starts at. Required. |
title | const string | no | The label shown beside the control. |
tooltip | const string | no | Help text for the control. |
inline | const string | no | A key that puts several controls on one row. Controls sharing a key share a row. |
group | const string | no | A heading the control sits under. |
confirm | const bool | no | Asks the reader to confirm the value. |
Returns input bool — An input bool. The input form is produced by the call, not written by you.
indicator("Colour switch")
plot(close, title = "Close", color = input.bool(true, "Use blue") ? color.blue : color.gray)See also inputs · input.color · input.float · input.int
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.