conditional

conditional(x)
Parameters
  • x (boolean) – Value for the current bar

Returns

series[boolean]

Converts a boolean value into the series of boolean values. Value for the current bar is set, when the function is invoked.

Example:

uptrend = conditional(close > open)
color = iff (uptrend [1], 'green', 'red')