Keywords
6 entries. What each one takes, what it returns, and a working example.
The logical AND connective (a language keyword, not a function). Combines two conditions; works bar-by-bar over series. Used to fold several filters into a single condition.
plot(iff(close > open and rsi(close, 14) > 50, 1, 0))
Plots 1 when the candle is up and RSI is above 50, otherwise 0.
The boolean false literal (a language keyword). Used as a checkbox default or to temporarily switch off a branch.
plot(iff(false, close, open))
Since the condition is always false, open is plotted.
The special value marking missing/undefined data (a language keyword). Warm-up empty bar results are na; also used to intentionally leave a value empty or create a gap in a plot. The na() function tests whether a value is na.
plot(iff(barIndex < 20, na, close))
Leaves the first 20 bars empty (na) and plots price afterwards.
The logical NOT operator (a language keyword). Inverts a condition; works bar-by-bar over series.
plot(iff(not (close < open), 1, 0))
Plots 1 when the candle is not down (i.e. up/equal).
The logical OR connective (a language keyword). The result is true when either condition holds; works bar-by-bar over series.
plot(iff(close > open or volume > sma(volume, 20), 1, 0))
Plots 1 when it is an up candle or volume is above its average.
The boolean true literal (a language keyword). Used as a checkbox default or to temporarily pin a condition on.
plot(iff(true, close, open))
Since the condition is always true, close is plotted.