Skip to main content

conditional

Syntax Format

conditional(x)

Overview

The conditional function converts a boolean value into the series of boolean values. The value for the current bar is set when the function is called.

Parameters

ParameterTypePurpose
xbooleanValue for the current bar

Returns: series[boolean].

Example

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